Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Version History

« Previous Version 4 Current »



Function: jsonToItems()

Converts a block of JSON data into a recordset which contains the attributes for each node. 

Syntax

jsonToItems(JSON String, JSON Path, Lenient)

ArgumentTypeDescription
JSON StringStringJSON string to be converted to recordset.
JSON PathString

The JSON Path expression is evaluated against the data provided by the JSON String. It determines which elements are extracted from the JSON.

Defaults to “$” which matches the entire document. This must be passed in as a string i.e. encapsulated in quotes.

Lenientboolean

Lenient is a flag which determines whether to pass the JSON String leniently. Defaults to false.

Error rendering macro 'excerpt-include' : No link could be created for 'JSON Node'.

Examples

Record Set Returned

jsonToItems('{"data":[{"value":"foo"},{"status":"bar"}]}', '$.data', true)

Returns

// returns a record set
{"value" : "foo"}, {  "value" : "bar"}

Array Returned

jsonToItems('{"data":[{"value":"foo"},{"status":"bar"}]}', '$.data', true).value

Returns

// returns an array of values*
[foo, bar]

*The array results can be accessed using normal Array Handling Functions

  • No labels