Skip to main content

Add item to dictionary

Sophie avatar
Written by Sophie
Updated over a week ago

Definition and Usage

Set a key-value pair in the dictionary. If the key already exists, its value will be updated.


Parameter Values

Input parameters

Parameter

Description

Possible Values

Required

Options / Notes

Dictionary

Select dictionary variable to add key-value pair

Any dictionary variable

Yes

Must be a valid dictionary object

Key

Enter the key for the dictionary entry. If this key exists, its value will be updated

Any valid key value

Yes

Keys are case-sensitive

Value

Enter the value to be associated with the given key in the dictionary

Any data type

Yes

Can be string, number, boolean, list, or another dictionary

Error handling

Parameter Name

Description

Throw error & stop

When an error occurs, the action will trigger an error and stop the execution of the entire app.

Retry command

If an error occurs, the action will retry the command in an attempt to resolve the issue and continue the process.

Ignore error & continue

When an error occurs, the action will be ignored, and the workflow will continue without interruption.

Variables produced

This action doesn't produce any variables.


Using Variables in Conditions

You can use variables for any parameter in this action by clicking the {x} button next to the input field. This allows you to dynamically set the dictionary, key, or value based on variables defined earlier in your workflow.

For example:

  • Use a variable for the key to dynamically access different dictionary entries

  • Use variables for values to store changing data in your dictionary


Notes

  • The dictionary must be initialized before using this action

  • If you add a key that already exists in the dictionary, the previous value will be overwritten

  • Dictionary keys are case-sensitive; "Name" and "name" would be treated as different keys

  • You can store various data types as values, including strings, numbers, booleans, lists, or even other dictionaries

  • To create a new dictionary, use the "Create dictionary" action before using this action

Did this answer your question?