ELEMENT.EXISTS() |
|
|
The ELEMENT.EXISTS() function tests whether an element exists in a data collection.
Format
ELEMENT.EXISTS(var{path})
where
The ELEMENT.EXISTS() function scans var to test whether element path exists. The function returns True if it is found, False if not.
Example
COL = JPARSE(JSON.STRING) IF NOT(ELEMENT.EXISTS(COL{'CLIENT', 'AGENT.CODE') THEN STOP 'Agent code not found' END
The above code fragment parses a JSON string into a data collection and then checks whether the CLIENT/AGENT.CODE element is present.
|