in Education by
I am trying to return multiple variable as an output from js Script in AutoamtionAnywhere. For example I have js script like this: var days = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Monday', 'Tuesday']; var months = ['January', 'February', 'March', 'April', 'May', 'June', 'August', 'September', 'October' , 'November', 'December']; var d = new Date(); var week_day = days[d.getDay()+2]; var day_number = d.getDate(); var month_name = months[d.getMonth()]; var month_number = d.getMonth(); if(month_number <= 9){ month_number.toString() month_number = "0" + month_number }; WScript.StdOut.WriteLine(week_day, day_number, month_name, month_number); In AAE I am also putting 4 different variables as an output (With comas and with only spaces): After running BOT I am receiving following error: Select the correct answer from above options

1 Answer

0 votes
by
 
Best answer
The return value in the “Run script” does not support multiple variables but in order to achieve what you are trying you can return the values by concatenating the values with some character .WScript.StdOut.WriteLine("ReturnValue1#ReturnValue2"); Your bot should fetch this value in one variable(say $Prompt-Assignment$) and then you can split it with string operator and assign it in some list variable.

Related questions

0 votes
    I am trying to return multiple variable as an output from js Script in AutoamtionAnywhere. For example I have js script ... ()]; var month_number = d.getMonth(); if(month_number...
asked Feb 5, 2022 in Education by JackTerrance
0 votes
    I'm wondering if size of AAE file has an impact on efficiency, speed of BOT. I mean when I wrote first version ... affect it's speed. Select the correct answer from above options...
asked Feb 1, 2022 in Education by JackTerrance
0 votes
    I have seen Microsoft Cognitive services such as text analytics and some other services. Here I have gone through ... much about it? Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
0 votes
    I am writing a task in Automation Anywhere and would like it to break if a certain variable is set to "false" ... the code is executed? Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
0 votes
    I am using AA for almost 6 months and I found that by default I am not able to see any lines/dotted lines/ ... to be set in properties? Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
0 votes
    I need help with Automation Anywhere I have the following Drop-Down List and need to select an option. < option ... "0002" Thank you. Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
0 votes
    I want to get a value from a particular location from list variable. Right now what I see is it only ... from a specified location? Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
0 votes
    How can I change the user input date format in Automation Anywhere without changing the system variable format? Example: ... 05/28/2018 Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
0 votes
    Hello I tried to use MWC function in AAE to pick the correct position form drop-down menu but I am receiving ... supposed to look like. Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
0 votes
    I'm learning AAE for like a week and I have problem with for loop in excel file. I have prepared table with ... and how to fix it? Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
0 votes
    I am writing a task in Automation Anywhere and would like it to break if a certain variable is set to "false" ... the code is executed? Select the correct answer from above options...
asked Feb 5, 2022 in Education by JackTerrance
0 votes
    I am using AA for almost 6 months and I found that by default I am not able to see any lines/dotted lines/ ... to be set in properties? Select the correct answer from above options...
asked Feb 5, 2022 in Education by JackTerrance
0 votes
    I need help with Automation Anywhere I have the following Drop-Down List and need to select an option. < option ... "0002" Thank you. Select the correct answer from above options...
asked Feb 5, 2022 in Education by JackTerrance
0 votes
    I want to get a value from a particular location from list variable. Right now what I see is it only ... from a specified location? Select the correct answer from above options...
asked Feb 5, 2022 in Education by JackTerrance
0 votes
    How can I change the user input date format in Automation Anywhere without changing the system variable format? Example: ... 05/28/2018 Select the correct answer from above options...
asked Feb 5, 2022 in Education by JackTerrance
...