Skip to content

Collections Activities

Version: 1.0.3  ·  ID: zoan-packages-collections  ·  Author: Zoan Software

The Collections package creates and manipulates the two most commonly used collection types: lists (sequences of elements) and dictionaries (key→value pairs). It is used to accumulate results, keep records, group related data or configure options.

Almost everything these activities do also has a direct equivalent in an expression. For example:

GoalActivityEquivalent expression
Count elementsList Countcount(list) or list.Count
Element by indexGet List Itemlist[0]
Does it contain?List Containslist.Contains(value)
Value of a keyGet Dictionary Valued["key"] (or dictGet(d, "key"), which gives null instead of failing when the key does not exist)
Add to listAdd to ListlistAdd(list, value)

Which one to use? The activities make the flow more explicit and visual (useful for those just starting out). The expressions are shorter and more comfortable when you are already inside another formula. Both are correct — choose according to whether you prefer clarity or concision. See Expressions › Collections.

Activities that return a result (create, count, get, check) deliver it through the activity’s output field, like every other activity: you pick there the variable that receives it (→ output: variable in the examples). Activities that modify a collection (add, set, remove, clear) change it in place and return nothing: any variable pointing to that list or dictionary sees the change.

ActivityTypeOutputWhat it does
Create Listlist-createListCreate a list, empty or with initial items
Add to Listlist-add—Add an item
Get List Itemlist-getobjectElement by index
List Countlist-countintNumber of elements
List Containslist-containsboolDoes it contain an element?
Remove from Listlist-remove-at—Delete by index
Clear Listlist-clear—Empty the list
ActivityTypeOutputWhat it does
Create Dictionarydict-createDictionaryCreate a dictionary, empty or with initial pairs
Set Dictionary Valuedict-set—Assign/update a key
Get Dictionary Valuedict-getobjectValue of a key
Dictionary Contains Keydict-contains-keyboolDoes the key exist?
Dictionary Countdict-countintNumber of pairs
Get Dictionary Keysdict-keysListAll the keys
Remove Dictionary Keydict-remove—Delete a key