Get Variable
Description
Section titled “Description”The Get Variable module allows getting the value of a variable previously stored with Set Variable. Internally it uses the base Variable module with the get action. Optionally, a data type can be specified so the value is automatically converted (for example, from string to integer or JSON). It also supports an optional filter for more specific searches. The obtained value is returned within the variable field of the output data.
Configuration
Section titled “Configuration”| Parameter | Type | Required | Description |
|---|---|---|---|
| key | text | Yes | Name of the variable to get. Supports {{variable}}. |
| data | text | No | Optional filter to search for the value. |
| type | select | No | Data type for value conversion: Text (varchar), Integer, Float, Boolean, JSON, Array, Date, DateTime. Default: varchar. |
Output
Section titled “Output”{ "nextModule": "siguiente_modulo", "data": { "variable": "valor_almacenado" }, "_meta_": { "key": "nombre_variable", "data": "" }}Usage Example
Section titled “Usage Example”Basic case
Section titled “Basic case”{ "label": "Get Variable", "key": "ultimo_pedido_id", "data": "", "type": "int"}- Internally executes the Variable module with
action: 'get'. - The value is returned in
data.variable. Subsequent nodes access the value withdata.variable. - If a data type is specified, automatic conversion is attempted. If conversion fails, the original value is kept.
- If the variable does not exist,
data.variablewill be null or undefined. - Supports dynamic variables
{{variable}}in the key. - The
data(filter) field is optional. If left empty, the variable is retrieved without filtering. - parentNode:
variable.
Related Nodes
Section titled “Related Nodes”- setVariable (to create/update variables)
- deleteVariable (to delete variables)
- variable (base module used internally)
- decision (to evaluate the obtained value)