Hi Chun,
I did something similar. I invoked R through a bat file, and then processed the results in the Bot. My bot was looking for Y or N in the output. See the code below.
Here is the same script ready for you to copy and paste into the RPA Studio:
defVar --name padWindow
--type Window
defVar --name exitCode
--type Numeric
defVar --name output
--type String
defVar --name error
--type String
defVar --name path
--type String
--value "D:/RPA/Lab - AI with RPA/Scenario5"
defVar --name customerDetails
--type String
--value "CruiseCustomerYes.csv"
runWindowsScript --scripttype "BATScript"
--source "Text"
--script "@echo off\r\n\r\nREM run r with params %1\r\n\r\nIF %1.==. GOTO No1\r\n\r\nset PATH=%PATH%;c:\\Program Files\\R\\R-4.1.1\\bin\r\nset SCRIPT_HOME=\"D:\\RPA\\A_ENABLEMENT\\LABS\\RPAAdvancedSept2021\\Lab 1 - AI with RPA\\Scenario5\"\r\n\r\nrscript %SCRIPT_HOME%\\PotentialCustomer.r %SCRIPT_HOME% %1 \r\n\r\nGOTO End1\r\n\r\n:No1\r\n ECHO No param 1\r\nGOTO End1\r\n\r\n:End1\r\n\r\necho %result%"
--arguments "
${customerDetails}"
--blockexecution exitCode=exitcode output=output error=error
getSubString --text "
${output}"
--start 5
--length 1 output=value
logMessage --message "
${output}"
--type "Info"
if --left "
${output}"
--operator "Equal_To"
--right Y
messageBox --title Cruise
--text "The customer would like a cruise\r\n"
--icon "Information"
--buttons "OK"
--defaultbutton "FirstButton"
else messageBox --title "No Cruise"
--text "The customer would NOT like a cruise\r\n"
--icon "Information"
--buttons "OK"
--defaultbutton "FirstButton"
endIf------------------------------
NIGEL CROWTHER
------------------------------
Original Message:
Sent: Tue August 09, 2022 03:14 AM
From: anh Chun Fan Yi
Subject: logical compute on output SPSS
Hi there.
I'm doing binary logistic regression in SPSS
Because I must do the research over and over again thousand times to find the appropriate alternative.
Therefore, I'd like to inquiry that: Is there any program, module… could do the logical compute on the output of SPSS?
For example: It could automatically keep which Variable has Sig <0.05 in "Variables in the Equation" table. And then export whole "Variables in the Equation" to excel.
Any idea is appreciated.
Thank you so much.
------------------------------
anh Chun Fan Yi
------------------------------