LIST
LIST:
itemType: { itemType } # required
items: # required
- { value1 }
- { value2 }
# ...
Description
The LIST operation creates a constant, ordered List of values. This operation allows you to define a static, ordered list of Text or Bytes strings directly within your logic. It preserves the order of elements and allows for duplicates.
Parameters
-
itemType(Text|Bytes, required):- Specifies the type of items in the list. Valid values are
TEXTorBYTES.
- Specifies the type of items in the list. Valid values are
-
items(list of strings, required):- A YAML list of strings that will form the list.
- Unlike a
SET, empty strings and duplicate values are preserved in the list.
Return Type
Examples
-
Creating a list with duplicate
Textitems:LIST:
itemType: TEXT
items:
- "a"
- "b"
- "a"This returns a list containing
["a", "b", "a"]. -
Creating a list that includes empty strings:
LIST:
itemType: TEXT
items:
- "a"
- ""
- "b"This returns a list containing
["a", "", "b"].