jsonscriptstring(
jsonscriptstring(
TEXT
)

The jsonscriptstring( function converts text into a JSON string literal

Parameters

This function has one parameter:

text – the original text.

Description

This function converts text into a JSON string literal. To do this the function surrounds the text with double quote characters, and escapes any double quote and/or backslash characters within the text. Use this function when you need a string literal inside the jsonimport( function or anytime you need to build JSON from Panorama data.

    jsonscriptstring({Make text into "JSON literal", including \ characters.})
        ☞ "Make text into \“JSON literal\“, including \\ characters."

Note: This function is equivalent to:

    {"}+replace(replace(thetext,{\},{\\}),{"},{"})+{"}

See Also

- databaseexportjson -- exports selected records in the current database in JSON format to a text file.
- exportjson -- exports the current database in JSON format.
- importjson -- imports a JSON array into the current database.
- importjsonline -- imports a JSON record into the current record.
- jsonexport( -- converts a Panorama dictionary or data array into JSON.
- jsonexportline( -- exports the current database record in JSON format.
- jsonimport( -- converts JSON into a Panorama dictionary or data array.
- newdatabasewithjson -- creates a new database using a JSON file.
- tsvtojson( -- converts tab separated text into JSON formatted text.

History

Version | Status | Notes
10.0 | New | New in this version.