Quotes Escape Character

I think this is straightforward but I’m struggling implementing. I have a JSON string that I need to update. This is the final result that I need:

{ “startInfo”: {“ReleaseKey”: “123”, “RobotIds”: [ 85599 ], “NoOfRobots”: 0, “Strategy”:“Specific”}}

When I go to add variables, such as in_ReleaseKey, into the string it works.

“{”“startInfo”“: {”“ReleaseKey”“: “+in_ReleaseKey+”,”“RobotIds”“: [85599],”“NoOfRobots”“: 0,”“Strategy”“: ““Specific””}}”

Below is the result I’m getting. I need only single quotes around everything. Can someone please point me in the right direction on how to do this? I need the final result to be formatted like the JSON above.

“{”“startInfo”“: {”“ReleaseKey”“: 123,”“RobotIds”“: [85599],”“NoOfRobots”“: 0,”“Strategy”“: ““Specific””}}”

Also if there is a better way to do this, I’m open to suggestions.

Thanks!

Hi @bradsterling

Just add a double quotes in front and back of “+in_ReleaseKey+”
like
" “+in_ReleaseKey+” "

and add a backward slash before other double quotes like

“{\“startInfo": {\“ReleaseKey\“: " “+in_ReleaseKey+” “,\“RobotIds\”: [85599],\“NoOfRobots\”: 0,\“Strategy\“: \“Specific\”}}”

Cheers buddy

3 Likes

Hi.

You are doing it correctly I believe already, because "{""startInfo"" will translate to {"startInfo" when you write this to a text file.

However, here is a suggestion to update values in a json object:
image
image

Then, just Write the string to a text file.

In that suggestion, I am just using an Assign to change the value of the key.

Regards.

2 Likes

Thanks @ClaytonM!

Also, thanks for all of your guidance around the Community.

-Brad

2 Likes

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