Get Dictionary Value
Get Dictionary Value
Section titled “Get Dictionary Value”Type: dict-get · Package: Collections Activities v1.0.3 · Output: object
Gets the value associated with a key in a dictionary.
How it works
Section titled “How it works”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.
Required parameters
Section titled “Required parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
dict | Dictionary | — | The dictionary. |
key | string | — | The key to look up. |
Optional parameters
Section titled “Optional parameters”None.
Output
Section titled “Output”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.
Common errors
Section titled “Common errors”| Message | Cause 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. |
Example
Section titled “Example”Get Dictionary Value dict = customer key = "name" → output: nameLog message = "Customer: " + str(name)Related activities
Section titled “Related activities”- Set Dictionary Value — assign a value.
- Dictionary Contains Key — check whether the key exists.