Try OpenEdge Now
skip to main content
ABL Reference
Class Properties and Methods Reference : GetJsonText( ) method (JsonObject)
 

GetJsonText( ) method (JsonObject)

Gets the named property as a LONGCHAR, regardless of the JSON data type. The following are the type of return values:
*If the property value is a simple type (string, number, boolean or null), it returns the value as it appears in the JsonObject as a string. For example, "abc", "123.45", "-13E+20", "true", "false", and "null".
*A JsonObject or JsonArray property is returned in its serialized form. That is, as a LONGCHAR representing all contained values. For example, {"name":"Alfred","age":32} or ["jump rope", 17].
The method is useful especially for situations where JSON number values cannot be represented by any of the ABL numeric data types (INTEGER, INT64 and DECIMAL). This method allows you to retrieve values regardless of the JSON data type. GetCharacter( ) and GetLongchar( ) require that the JSON value be a JSON string.
Return type: LONGCHAR
Access: PUBLIC
Applies to: Progress.Json.ObjectModel.JsonObject class

Syntax

GetJsonText( )

GetJsonText( INPUT property-name AS CHARACTER )
With one parameter, the value of the named property is returned. With no parameters the value of the entire JsonObject is returned.
property-name
A optional CHARACTER expression that denotes the name of the property value to be retrieved from the JsonObject. The default is to return the entire object.
A JsonError is raised if:
*property-name is the empty string (""), or is the Unknown value (?)
*The property does not exist
*The property value contains a character that cannot be code page converted to -cpinternal