Overview
The Get Global Block is used to retrieve a global value that is shared across all flows and subflows. The ID of the global value is configured in this block. The block can be configured to retrieve the value on demand, which means it will be read when blocks need it, rather than when this block executes. This is useful when the global value might change during the execution of the flow. The block can also be configured to wait until the variable is available. This is useful when the global value is set by another block that might not have completed its execution when this block runs.- Inputs
- Outputs
- Editor Settings
Inputs
| Title | Data Type | Description | Default Value | Notes |
|---|---|---|---|---|
| Variable ID | string | The ID of the global variable to retrieve. This input is only available if the “Use Input” toggle is checked. | N/A | The input will be coerced into a string if it is not a string. |
Example 1: Retrieve a global variable
- Add a Set Global Block to the flow. Set the variable name to
myGlobalVariableand the value toHello Worldusing a Text Block. - In a separate part of the flow, add a Delay Block and set the delay to
1000(1 second). - Create a Text Block and set the text to
myGlobalVariable. Pass the text into the Delay Block. - Create a Get Global Block, enable the input for “Variable Name”, and pass the output of the Delay Block into the input. Disable the “On Demand” setting.
Example 2: Retrieve a global variable on-demand
- Add a Set Global Block to the flow. Set the variable name to
myGlobalVariableand the value toHello Worldusing a Text Block. - Add a Get Global Block and set the variable name to
myGlobalVariable. Enable the “On Demand” setting. - Add an If Block. Set the
Ifinput to the Set Global Block, and set theValueinput to the Get Global Block. This will wait for both blocks to complete before running, and will pass the Get Global Block’s value through to the next block. - Add a Text Block and connect the If Block to the Text Block.
- Run the flow. Notice that the value of the If block is
Function<string>because the “On-Demand” setting has been enabled, causing the value to not have resolved yet. The value is resolved in the Text Block, and “Hello World” is displayed.
Error Handling
The Get Global Block will error if the global variable is not found and theWait setting is disabled. If the Wait setting is enabled, the block will wait until the variable is available.
FAQ
Q: What is a global variable? A: A global variable is a value that is shared across all flows and subflows. It is set using a Set Global Block and retrieved using a Get Global Block. Q: Can I set a global variable from a parent application? A: No, global variables can only be set from within the flow. Use a Context Block instead to access global variables set by the parent application. Q: What happens if the global variable is not found? A: If the global variable is not found and theWait setting is disabled, the Get Global Block will return the default value for the data type selected. For example, if the data type is set to string, the default value will be an empty string. If the Wait setting is enabled, the block will wait until the variable is available before returning the value.

