AppendArray method (NotesJSONNavigator - LotusScript

Appends a NotesJSONArray to the NotesJOSNNavigator.

Defined in

NotesJSONNavigator

Parameters

name

String. Optional. Name of the array. When called on an empty navigator with the name parameter omitted, the root value of the NotesJSONNavigator is changed from NotesJSONObject to NotesJSONArray.

Return value

Returns NotesJSONArray that was appended to the NotesJSONNavigator.

Example 1

Create an array and append four strings.

Dim jsnav As NotesJSONNavigator
Dim arr As NotesJSONArray
Set arr = jsnav.appendArray()
Call jsnav.appendElement("An")
Call jsnav.appendElement("array")
Call jsnav.appendElement("of")
Call jsnav.appendElement("strings")

Result:  ["An","array","of","strings"]

Example 2

Append array of four strings named "myarray" to the NotesJSONNavigator.
Dim jsnav As NotesJSONNavigator
Set jsnav = session.createJSONNavigator("")
Dim arr As NotesJSONArray
Set arr = jsnav.appendArray("myarray")
Call arr.appendElement("An")
Call arr.appendElement("array")
Call arr.appendElement("of")
Call arr.appendElement("strings")

Result: {"myarray":["An","array","of","strings"]}