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 special characters within the text (for example double quote, slash or backslash characters). 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."

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.2 | New | Fixed so that it works with all special characters that need to be escaped, not just \ and ".
10.0 | New | New in this version.