Variables
Last updated
Last updated
Variables can help configure time ranges, eliminate hardcoded values, or supply data for model configuration. In a Recurve project, you can define variables as assets and use them across multiple models.
There are two scopes for variables in Recurve:
Local variables are defined in a model using Jinja syntax; they are scoped locally and only accessible within the model.
Global variables defined in Library > Variables, are project-level assets and accessible from any models in the project.
When we refer to "variables" generally, we mean global variables.
Variables are defined with explicit types to remove the need for casting and prevent format errors. When building a model (whether in preview, console, or pipeline) that has variables, you can use pre-defined default values or overwrite them with custom inputs.
To define a project variable, follow these steps:
In Recurve, open your project and go to Library > Variables.
Click +Add New.
Provide the name, data type, description, and value for the variable.
Recurve supports creating project variables with explicit data types.
Click Add.
The new variable will be displayed in the Variables section of Library.
By default, a created variable is active and ready for use in models. You can deactivate the variable by toggling off the Active option.
You can start referencing the defined variable in models with the {{ var('variable_name') }}
expression.
For example, the following model uses the min_order_dateime
defined in the project library.