assistance-engine/docs/developer.avapframework.com/chapter9_23.md

774 B

Usage Example

Creation and management of lists:

// Creating a list 
variableToList("item1", "myList") 
variableToList("item2", "myList") 
variableToList("item3", "myList")

// Retrieving an item from the list 
itemFromList("myList", 1, "myVariable")

// Getting the length of the list 
getListLen("myList", "listLength")

Creation and management of objects (dictionaries):

// Creating an object 
AddvariableToJSON("key1", "value1", "myObject")
AddvariableToJSON("key2", "value2", "myObject")

// Retrieving a value by key from the object
variableFromJSON("myObject", "key1", "myVariable")

In this way, lists and objects in AVAP can be manipulated using the specific functions provided for working with variables stored as strings.