Skip to main content
Set Global Block Screenshot

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

TitleData TypeDescriptionDefault ValueNotes
ValueAnyThe 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 IDstringThe 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

  1. Create a Text Block and set the value to Hello, World!.
  2. Create a Set Global Block and set the ID to greeting.
  3. Connect the Text Block to the Value input of the Set Global Block.
  4. Run the flow. The Value output of the Set Global Block should contain the value Hello, World!.
Set Global Block Example 1

Error Handling

The Set Global Block will error if the Value 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 the Value input of the Set Global Block.

See Also