JsonArray Data type

Version: Available or changed with runtime version 1.0.

Is a container for any well-formed JSON array. A default JsonArray contains an empty JSON array.

Instance methods

The following methods are available on instances of the JsonArray data type.

Method name Description
Add(JsonToken) Adds a new value at the end of the JsonArray.
Add(JsonArray) Adds a new value at the end of the JsonArray.
Add(JsonObject) Adds a new value at the end of the JsonArray.
Add(JsonValue) Adds a new value at the end of the JsonArray.
Add(Boolean) Adds a new value at the end of the JsonArray.
Add(Char) Adds a new value at the end of the JsonArray.
Add(Byte) Adds a new value at the end of the JsonArray.
Add(Option) Adds a new value at the end of the JsonArray.
Add(Integer) Adds a new value at the end of the JsonArray.
Add(BigInteger) Adds a new value at the end of the JsonArray.
Add(Decimal) Adds a new value at the end of the JsonArray.
Add(Duration) Adds a new value at the end of the JsonArray.
Add(Date) Adds a new value at the end of the JsonArray.
Add(Time) Adds a new value at the end of the JsonArray.
Add(DateTime) Adds a new value at the end of the JsonArray.
Add(Text) Adds a new value at the end of the JsonArray.
AsToken() Converts the value in a JsonArray to a JsonToken data type.
Clone() Creates a deep-copy of the JsonArray value.
Count() Gets the number of elements in the JsonArray.
Get(Integer, var JsonToken) Retrieves the value at the given index in the JsonArray.
IndexOf(JsonToken) Determines the index of a specific value in the JsonArray.
IndexOf(JsonArray) Determines the index of a specific value in the JsonArray.
IndexOf(JsonObject) Determines the index of a specific value in the JsonArray.
IndexOf(JsonValue) Determines the index of a specific value in the JsonArray.
IndexOf(Boolean) Determines the index of a specific value in the JsonArray.
IndexOf(Char) Determines the index of a specific value in the JsonArray.
IndexOf(Byte) Determines the index of a specific value in the JsonArray.
IndexOf(Option) Determines the index of a specific value in the JsonArray.
IndexOf(Integer) Determines the index of a specific value in the JsonArray.
IndexOf(BigInteger) Determines the index of a specific value in the JsonArray.
IndexOf(Decimal) Determines the index of a specific value in the JsonArray.
IndexOf(Duration) Determines the index of a specific value in the JsonArray.
IndexOf(Date) Determines the index of a specific value in the JsonArray.
IndexOf(Time) Determines the index of a specific value in the JsonArray.
IndexOf(DateTime) Determines the index of a specific value in the JsonArray.
IndexOf(Text) Determines the index of a specific value in the JsonArray.
Insert(Integer, JsonToken) Inserts the value at the given index in the array while shifting all the values to the right by one position.
Insert(Integer, JsonArray) Inserts the value at the given index in the array while shifting all the values to the right by one position.
Insert(Integer, JsonObject) Inserts the value at the given index in the array while shifting all the values to the right by one position.
Insert(Integer, JsonValue) Inserts the value at the given index in the array while shifting all the values to the right by one position.
Insert(Integer, Boolean) Inserts the value at the given index in the array while shifting all the values to the right by one position.
Insert(Integer, Char) Inserts the value at the given index in the array while shifting all the values to the right by one position.
Insert(Integer, Byte) Inserts the value at the given index in the array while shifting all the values to the right by one position.
Insert(Integer, Option) Inserts the value at the given index in the array while shifting all the values to the right by one position.
Insert(Integer, Integer) Inserts the value at the given index in the array while shifting all the values to the right by one position.
Insert(Integer, BigInteger) Inserts the value at the given index in the array while shifting all the values to the right by one position.
Insert(Integer, Decimal) Inserts the value at the given index in the array while shifting all the values to the right by one position.
Insert(Integer, Duration) Inserts the value at the given index in the array while shifting all the values to the right by one position.
Insert(Integer, Date) Inserts the value at the given index in the array while shifting all the values to the right by one position.
Insert(Integer, Time) Inserts the value at the given index in the array while shifting all the values to the right by one position.
Insert(Integer, DateTime) Inserts the value at the given index in the array while shifting all the values to the right by one position.
Insert(Integer, Text) Inserts the value at the given index in the array while shifting all the values to the right by one position.
Path() Retrieves the JSON path of the array relative to the root of its containing tree.
ReadFrom(Text) Reads the JSON data from the string into a JsonArray variable.
ReadFrom(InStream) Reads the JSON data from the stream into a JsonArray variable.
RemoveAt(Integer) Removes the token at the given index.
SelectToken(Text, var JsonToken) Selects a JsonToken using a JPath expression.
Set(Integer, JsonToken) Replaces the value at the given index with a new value.
Set(Integer, JsonObject) Replaces the value at the given index with a new value.
Set(Integer, JsonArray) Replaces the value at the given index with a new value.
Set(Integer, JsonValue) Replaces the value at the given index with a new value.
Set(Integer, Boolean) Replaces the value at the given index with a new value.
Set(Integer, Char) Replaces the value at the given index with a new value.
Set(Integer, Byte) Replaces the value at the given index with a new value.
Set(Integer, Option) Replaces the value at the given index with a new value.
Set(Integer, Integer) Replaces the value at the given index with a new value.
Set(Integer, BigInteger) Replaces the value at the given index with a new value.
Set(Integer, Decimal) Replaces the value at the given index with a new value.
Set(Integer, Duration) Replaces the value at the given index with a new value.
Set(Integer, Date) Replaces the value at the given index with a new value.
Set(Integer, Time) Replaces the value at the given index with a new value.
Set(Integer, DateTime) Replaces the value at the given index with a new value.
Set(Integer, Text) Replaces the value at the given index with a new value.
WriteTo(var Text) Serializes and writes the JSON data of the JsonArray to a given Text object.
WriteTo(OutStream) Serializes and writes the JSON data of the JsonArray to a given OutStream object.

Note

For performance reasons all HTTP, JSON, TextBuilder, and XML types are reference types, not value types. Reference types holds a pointer to the data elsewhere in memory, whereas value types store its own data.

Note

The JsonArray is 0-based by design.

Get Started with AL
Developing Extensions