Contains$ is used to check if a parsed JSON contains a given property.
RETURN_VALUE = JSON_OBJECT.Contains$(JSON_POINTER)
RETURN_VALUE is an integer that contains the information returned by the Contains$ query.JSON_OBJECT is the JSON object where Contains$ query is applied.JSON_PATH is the JSON POINTER expression that contains the query to be checked if it exists in the JSON object.# Procedure to select a property
Local Clbfile SRCJSON
SRCJSON = '{"msg":"Hello World!"}'
# Create the object
Local Instance OBJ Using OBJECT
# Parse the object
ParseInstance OBJ With SRCJSON
# Check if the JSON contains a property
Local Integer R
R = OBJ.Contains$("/msg")
FreeGroup OBJ
| Value | Explanation |
|---|---|
| 0 | Operation succeeded. |
| -6 | The name of the variable does not exist in the JSON document. |
| -70 | Invalid argument type. |