Using Project Configurations and Flow Variables in an Expression Step

When building screen flows, it is common to need configuration values or flow variables inside an Expression step -for example, to modify or evaluate data during the flow execution. Previously, this required explicitly mapping those values from screens into the Expression step, resulting in redundant, repetitive mappings just to make the values accessible.

Starting from OpenLegacy Hub version 3.0.31, OpenLegacy allows users to access Flow Variables and Project Configurations directly inside an Expression step.

Prerequisites

Before using this feature, make sure you have at least one of the following set up in your project:

  • Project Configuration – a key-value configuration defined at the project level.
  • Flow Variable – a variable defined within your flow.

Accessing Values in the Expression Step

Inside the Expression step's code block, you can access these values using the following special keywords:

KeywordDescription
$configAccess Project Configuration values
$variablesAccess Flow Variable values

How to Use

  1. Open your flow and navigate to the Expression step.
  2. Inside the code block, type $config or $variables.
  3. Add a . (dot) after the keyword — the editor will display an autocomplete suggestion list based on your available configurations or variables.

Example

(inputStr) => {
    const input = JSON.parse(inputStr);
    output = {};

    $config.MY_CONFIG1  // Access a project configuration value
    $variables.MY_VAR   // Access a flow variable value

    return JSON.stringify(output);
}

When you type $config. or $variables., the editor will suggest the available project configurations.


Notes

  • This feature is available starting from OpenLegacy Hub version 3.0.31 and above.
  • Autocomplete suggestions are context-aware and will only show configurations or variables relevant to your current project and flow.