Variables
The Variables feature in LemmeBuild allows you to define key-value pairs that can be accessed and manipulated throughout your workflow. These variables provide a flexible way to store and reference data at various points during workflow execution, making it easier to manage dynamic values such as user inputs, counters, or settings. By using variables, you can ensure that important data is available across multiple blocks without the need to hard-code values.
Defining Variables
To define a variable, specify a key (the name of the variable) and a value (the data you want to store). These variables can represent a wide range of data types, such as strings, numbers, objects, or arrays.
Once defined, these variables are stored in the $vars
object and are globally accessible across your entire workflow. This means that any block within the workflow can use or modify the value of a variable, giving you complete control over the flow of data.
Example
Define a variable for user input:
$vars.userInput = 'John Doe';
Using Variables
Once a variable is defined, it can be referenced in any block by calling the $vars
object followed by the variable name. This ensures that data can be dynamically updated and reused throughout your workflow, making your automation more efficient.
Example
Access the previously defined userInput
variable:
console.log($vars.userInput);
This makes it easy to pass dynamic values between blocks, store user inputs, or manage counters, flags, and other data that evolves as the workflow progresses.
Modifying Variables
Variables can be updated at any point in the workflow. This allows for real-time adjustments based on conditions or user interactions. Simply update the value associated with the key in the $vars
object, and the new value will be accessible for the remainder of the workflow.
Example
Update the userInput
variable:
$vars.userInput = 'Jane Doe';
Why Use Variables?
The Variables feature is essential for creating dynamic, adaptable workflows. By storing data in key-value pairs that can be accessed and updated throughout the workflow, you ensure that important information is easily managed and available when needed. Whether you're handling user inputs, tracking progress, or setting flags, variables provide a streamlined way to manage dynamic data across multiple blocks.
With Variables in LemmeBuild, you gain flexibility and control over how data flows through your workflows, making your automation processes more dynamic and responsive to real-time inputs.