Robot commandline JSON input? How do i do multiple

How do i start a robot with multiple input? nothing in the documentation tells me how to, it just refers to JSON, but it’s JSON, only JSON like. So how do i get this to work?

I have setup a new process that wil take two boolean arguments, toLive and test with false as default value. When run it will convert both to string and display a text box for each

Test 1 (fails)
UiRobot.exe -p “BlankProcess” -input “{‘toLive’: ‘True’, ‘test’: ‘True’}”

Result 1
Robot CLI returns:
Unterminated string. Expected delimiter: ". Path ’ ', line1, position11.

Test 2 (works)
UiRobot.exe -p “BlankProcess” -input “{‘toLive’: ‘True’}”

Result 2
toLive = True| test = false

Test 3 (works)
UiRobot.exe -p “BlankProcess” -input “{‘test’: ‘True’}”

Result 3
toLive = False | test = True

Test 4 (fails)
UiRobot.exe -p “BlankProcess” -input “{‘toLive’: ‘True’}” -input “{‘test’: ‘True’}”

Result 4
toLive = False | test = True

I have tried a lot more combinations of what you have seen here with the same results as in not working :confused:

The documentation on this should be way more clearer than it is right now. Because trying to build a proper JSON as shown on w3schools documentation site for building JSON, it flat out refuses to use it. So when the top search result on almost any search engine on how to do json isn’t working you should not casually use JSON as a reference, unless showing a proper example with multiple inputs.

Can some one show me a working example of setting two booleans through robot input argument?

1 Like

Instead why don’t you use a file to pass the parameters, ie keep the values in a file and pass the file name as parameter.

Thank you for the idea, i’m already using that on some robots but i have a few specific robots where i need to pass it directly and not by file when starting them, hence why i’m asking about doing it this way and not by file. I won’t bore you with the details why, in these cases it is just not possible, as management of this would be less than ideal.

For any other reading, I need an answer on this specific way - thank you.

Bumping this one, still need an answer

EDIT: @ovi can you help ?

Hi @Rasmus_J

See here:

I’ve just tested it on Studio CE 2019.1 and it work like so:

\Main.xaml" -input "{'in_argument' : 'NewValue', 'in_argument2' : 'NewValue2'}"
1 Like

Hi @loginerror,

Thank you for the feedback, do you have the option to try on 2018.4.2 Enterprise and run with the process name instead of calling the XAML file so we can test if it’s a problem with either the version or calling with processname? I did try following the help page on this and I figured it was just a ‘,’ that was needed even though there is no example on multiple arguments (this should be added), but any process I run with more than one argument gets ignored.

Never mind, it was a brain fart.

Issue is the platform i’m calling UiRobot from, more specific AHK

I just tested the robot from powershell with multiple arguments and it worked, so i figured it had to be an issue when launching from an AHK script as I’m not normally doing that and go figure, it was the comma in the JSON like array between the two arguments that had to be escaped like this: `,

This will not work
RunWait, "C:\Program Files (x86)\UiPath\Studio\UiRobot.exe" -p "BlankProcess" -i "{'toLive': 'True', 'test': 'True'}"

this will
RunWait, "C:\Program Files (x86)\UiPath\Studio\UiRobot.exe" -p "BlankProcess" -i "{'toLive': 'True'`, 'test': 'True'}"

1 Like

Feel free to use forum markup for codeblocks, there are multiple ways

either add 4 spaces in from of the new line

add text between two ` signs, like so:
your text

or add text between two triple ` signs

your text here

like so:

your text

Just for clarity, a picture of the post :smiley:

1 Like

I tried to use markup but it removed the missing symbol that was causing the error and then the post didn’t make any sense at all. and since i’m at work and getting paid to do my job and not fiddle around with forum posts, I just posted it in clear text. feel free to edit the post.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.