GetJsonText( ) method (JsonArray)
- Last Updated: February 11, 2026
- 2 minute read
- OpenEdge
- Version 13.0
- Documentation
Gets one or more elements as a LONGCHAR or LONGCHAR array, regardless of the JSON data type.
The following are the type of return values:
- If the element is a simple type (string, number, boolean or null), it returns the value as it appears in the JsonArray as a string. For example, "abc", "123.45", "-13E+20", "true", "false", and "null".
- A JsonObject or a JsonArray element is returned in its serialized form. That is, as a LONGCHAR representing all the values it contains. For example, {"name":"Alfred","age":32} or ["jump rope", 17].
The
method is useful especially in 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.JsonArray class
Syntax
|
When this method is called with one parameter, the value of a single element is returned. Using no parameters directs the AVM to return the value of the entire JsonArray. Using two parameters directs the AVM to return an ABL array consisting of count elements.
- index
- An INTEGER identifying the value of the element to be returned. Indexing into JsonArrays is 1-based.
- count
- An INTEGER specifying the number of elements, starting with the element at index, to be returned in the ABL array.
A JsonError is raised if:
-
index is
less than 1, is greater than the length of the JsonArray, or is
the Unknown value (
?) -
count is less than 1 or is the Unknown value (
?) - The sum of index and count is greater than the length of the JsonArray
- The JSON value contains a character that cannot be code page converted
to
-cpinternal