Skip to content

How do I unquote JSON values and returns the result as a string

This example demonstrates removeing escape characters from a json value and returns string using the "jsonUnquoteValue" command.

In the solution shown below, the string value is stored into the variables using the "jsonUnquoteValue" command, and then remove those quotation marks and newline (\n) character.

Solution:

# Command Target Value
Unquoting the JSON value and storing it in a variable
1 jsonUnquoteValue {"age":"45", "income":20000, "Zipcode":08817, "result":"You are eligible for a subsidy.\n"} UnquotedValue

Tips, Tricks, Gotchas & Best Practices:  

  • You can remove the first and last non-blank characters of a character string value that has matching quotation marks. this command does not consider quotation marks matching if one of them is a single quotation mark and another is a double quotation mark.
  • As a best practice, it is always advisable to define the variable names without any spaces and if you want to differentiate the words, use underscores.


Feedback and Knowledge Base