%JSON_ObjectGetValue function


Function

Get value in field from JSON object.

Declaration


UNIVAL %JSON_ObjectGetValue(
    INT in handle, 
    TEXT in field
 )


Parameters


handleHandle to parent JSON object.
fieldField name


Return value

Value of type BOOL, INT, REAL or TEXT, or invalid value.

Description

Function get value in field from JSON object.

Exception is thrown if item at index is not value, handle to JSON object is invalid or field does not exists.

Example


 INT _obj
 _obj := %JSON_ObjectFromString('{"Name":"John"}')
 
 TEXT _txt
 _txt := %JSON_ObjectGetValue(_obj, "Name")

 %JSON_FreeObjectHandle(_obj)