Link Search Menu Expand Document

JSON Constants

The JSON package defines JSON constants. JSON constants can be used by the « operator to populate the JSONDocument object.

CRS syntax, constants (such as $RED), operators (such as + and-), functions, etc. cannot be used inside JSON constant blocks because they are not grammatically related to CRS scripts. You have to follow the format as JSON.

You can write JSON data directly in the CRS script in the following format.

json <<-
(JSON data)
->>;

Use Example

var j = new JSONDocument();
j << json <<-
{
    "data": [
        {
            "title": "Record 1",
            "item1": "Item 1",
            "item2": "Item 1",
            "item3": "Item 1"
        }
    ]
}
->>;