How to pass a variable or argument inside double quotes

Hi,

In Orchestrator Http Request activity, under input >> “JSON PayLoad” property, how to pass a variable?

Example: The default code which is working already is:
"{startInfo:

{ReleaseKey: ‘5791f38e-27c7-45bb-ac1d-5f7fa05fd158’,

 Strategy: 'Specific',

RobotIds: [ 74 ],

JobsCount: 0,

Source: ‘Manual’ } }"

I want to pass two arguments called “In_ReleaseKey” and “In_RobotID” in the above example. So I wrote the code like,

"{startInfo:

{ReleaseKey: ‘"+In_ReleaseKey+"’",

 Strategy: 'Specific',

RobotIds: [ In_RobotID ],

JobsCount: 0,

Source: ‘Manual’ } }"

I have tried all the possible ways of putting double quotes but still I am getting the error, “String Constant must end with a double quote”. Please help me to resolve this. Kindly try in your own activity and try to solve the above error, then please send me the code.

Regards,
Sadeesh

Just assign the entire request body to a string type variable and give the two values you have as

"+ In_RobotID +" and "+In_ReleaseKey + "

Then give the variable to the request directly @Sadeesh

Hi Hareesh,

I have tried your idea, but I think am missing something.
Can you please share some screenshots or attach your workflow directly if you can.

Here is the screenshot :slight_smile: @Sadeesh

And the body formed with the variables are

"My values inside the body of the http request" + ReleaseKey + "Added release key to the body " + RequestID + "request ID is added "

image

Hi Hareesh,
Double and single quotes inside JSONPayload property should be there as it is. Eventhough we are assigning it to a variable, single quotes are there to disturb.
Please find the attachment, open it and try to replace release key with In_ReleaseKey argument and Robot ID with In_RobotID argument.
Implement your idea and send the workflow back to me if you find no erros.
Thanks in advanceStart Job.xaml|attachment (5.9 KB)

Just make the double quotes also as single quotes @Sadeesh, That won’t affect the request JSON :slight_smile:

And I don’t get your workflow

Sorry.Please find the Zip file attachment.Start Job.zip (1.7 KB)

Hi Hareesh,

Thank you very much. Now am using like this, “{startInfo:{ReleaseKey: '”+In_ReleaseKey+"’,Strategy: ‘Specific’,RobotIds: [ “+In_RobotID+” ],JobsCount: 0,Source: ‘Manual’ } }"

It is working perfrctly.

Regards,
Sadeesh

Happy to help @Sadeesh

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