Overview
The Set Global Block is used to set a global value that is shared across all flows and subflows during an execution in Odella. This can be useful for storing and retrieving values that need to be accessed by multiple flows. The Set Global Block allows you to specify the ID of the global value and the value itself. The ID can be either a static string or an input value. The value can be of any data type.- Inputs
- Outputs
- Editor Settings
Inputs
| Title | Data Type | Description | Default Value | Notes |
|---|---|---|---|---|
| Value | Any | The value to be set as the global value. | (required) | The input will be coerced into the data type specified in the block’s settings. |
| Variable ID | string | The ID of the global value to be set. This input is only available if Use Variable ID Input is on. | (optional) | The input will be coerced into a string if it is not a string. The ID must be unique in the context. |
Example 1: Set a global value
- Create a Text Block and set the value to
Hello, World!. - Create a Set Global Block and set the ID to
greeting. - Connect the Text Block to the
Valueinput of the Set Global Block. - Run the flow. The
Valueoutput of the Set Global Block should contain the valueHello, World!.
Error Handling
The Set Global Block will error if theValue input is not provided or if the ID of the global value is not provided or not unique.
FAQ
Q: Can I set a global value to an array or an object? A: Yes, you can set a global value to any data type, including arrays and objects. You can use an Array Block or an Object Block to create an array or an object, and then connect it to theValue input of the Set Global Block.

