Using STRINGTOJSON

Let us now understand how to use the STRINGTOJSON() function. Let us consider here a sheet that has a column with String JSON which now we want to use as a JSON object to fetch the Name key.

Consider that the column with String Json is as seen in the screenshot below.

Now let us use the STRINGTOJSON function to convert it to a JSON object.

STRINGTOJSON(LOOKUP([Prod_depend_Doc.json_object], Prod_depend_Doc.unique_id=1))

Now consider that you want to display the Name in a Text control. So to do that the values from the JSON object would have to be fetched using functions like GETKEYVALUE as follows in the Custom Formula of that text control.

GETKEYVALUE(STRINGTOJSON(LOOKUP([Prod_depend_Doc.json_object], Prod_depend_Doc.unique_id=1)), “name”)

Which would then return the value as “John” for the “name” key.
json output

The purpose of these JSON functions is to extract values of the specified keys from the JSON. You can use the output of the STRINGTOJSON to functions like GETKEYVALUE(), MAPKEYS() to use them in any control.