Skip to content

Get Dictionary Value

Type: dict-get  ·  Package: Collections Activities v1.0.3  ·  Output: object

Gets the value associated with a key in a dictionary.

Looks up key in dict and returns its value. The key is converted to text and, in dictionaries created with Create Dictionary or newDict(), it is case-sensitive. If the key does not exist, the activity fails with a clear message: that way a misspelled name does not go unnoticed. It does not modify the dictionary.

ParameterTypeDefaultDescription
dictDictionary—The dictionary.
keystring—The key to look up.

None.

Returns an object with the value stored under the key, with its original type (text, number, list…). If the key exists but its value is null, it returns null.

MessageCause and fix
Key '…' not found in dictionary.The key does not exist. Check first with Dictionary Contains Key, or use the expression dictGet(d, "key"), which returns null instead of failing.
'dict' must be a Dictionary, got ….dict is not a dictionary (the message shows the type received, or null).
'key' cannot be null.The key expression returned null.
Get Dictionary Value dict = customer key = "name" → output: name
Log message = "Customer: " + str(name)