Get Started
Collection

Collection

Adds, retrieves, and removes values in a collection. A collection is a store for many values and comes in two types, list and map. The collection type and its key and value types are set when the collection is created in Settings > Collection (Part 6).

  • List: Stores values in order. Each value has an index (position number) starting from 0, and values are found, added, changed, and removed by index.
  • Map: Stores values as key-value pairs. The key is a unique identifier, and values are found, added, changed, and removed by key.

An example list (a shopping list) looks like this.

IndexValue
0Apple
1Milk
2Meat
3Ramen

An example map (a phone book) looks like this.

KeyValue
John Smith010-1111-2222
Emily Johnson010-2222-3333
Michael Brown010-3333-4444
Collection

Select the collection to use. The list commands or the map commands below are shown according to the type of the selected collection, and the value and key fields take the input format of the value type and key type set for the collection.

List commands

CommandDescriptionInput fieldsOutput variables
Push FrontAdds a value at the first position (index 0).Value
Push BackAdds a value at the end of the list.Value
Insert AtAdds a value at the given position.Position, Value
ResizeChanges the size of the list. A collection with a maximum size cannot exceed it.List Size
Remove FrontRemoves the first value.
Remove BackRemoves the last value.
Remove AtRemoves the value at the given position.Position
Clear AllRemoves all values.
Get FrontReads the first value.Value
Get BackReads the last value.Value
Get AtReads the value at the given position.PositionValue
FindFinds a value and returns its position. Returns -1 if the value is not found.ValueValue Position (number)
Set AtChanges the value at the given position.Position, Value
SizeReads the number of values in the list.List Size (number)
Is EmptyReturns true if the list is empty.Is Empty List (digital)
Sort AscendingSorts the values in ascending order.
Sort DescendingSorts the values in descending order.
ReverseReverses the current order.

Position is a 0-based index (0 to 4294967295), and the default of the List Size input is 10. The Value input and the Value output variable follow the value type of the collection.

Map commands

CommandDescriptionInput fieldsOutput variables
AddAdds a key-value pair.Key, Value
SetChanges the value associated with the key.Key, Value
RemoveRemoves the key-value pair.Key
Get ValueReads the value associated with the key.KeyValue
FindChecks whether the key exists.KeyKey Exists (digital)
Clear AllRemoves all key-value pairs.
SizeReads the number of pairs in the map.Map Size (number)
Is EmptyReturns true if the map is empty.Is Empty Map (digital)

The Key input follows the key type of the collection, and the Value input and output variable follow its value type.