Skip to content

Get Dictionary Keys

Type: dict-keys  ·  Package: Collections Activities v1.0.3  ·  Output: List

Gets all the keys of a dictionary as a list. Useful to loop through every entry with a For Each.

Copies the keys of dict into a new list, in dictionary order. Since it is a copy, you can modify the dictionary (for example, remove keys) while looping through the list without problems.

ParameterTypeDefaultDescription
dictDictionary—The dictionary.

None.

Returns a List (List<object>) with the keys; empty if the dictionary has no entries.

MessageCause and fix
'dict' must be a Dictionary, got ….dict is not a dictionary (the message shows the type received, or null).

Loop through each pair of the dictionary:

Get Dictionary Keys dict = totalsByCity → output: cities
For Each items = cities itemVariable = city
└─ activities:
Get Dictionary Value dict = totalsByCity key = city → output: total
Log message = city + ": " + total