Global Variables
Global variables in Arigato allow you to store values that can be accessed and reused across multiple workflows, actions, and triggers. They help maintain consistency, simplify workflow management, and reduce repetitive data entry.
Configuring Global Variables
To create and manage global variables in Arigato, follow these steps:
- Go to the Storage section in your Arigato app.
- Navigate to the Global Variables tab.
- Click Create Variable and define the variable name, type, and initial value.
- Save the variable. It will now be accessible in any workflow or action across your store.
| Field Name | Description | Example |
|---|---|---|
| Variable Name | A unique identifier for the global variable. Use descriptive names for clarity. | store_discount_rate |
| Variable Type | Defines the type of value the variable holds (Text, Number, Boolean, JSON, or Date). | Number |
Using Global Variables in Workflows
Once a global variable is created, it can be used in any workflow or action by referencing it with the syntax {{ global_vars["variable_name"].value }}.
For example, to apply a discount in an order action, you can set the discount field to {{ global_vars["store_discount_rate"].value }}.
As a best practice, wrap global variables that expect specific objects in “if object exists” statements. This ensures they only evaluate when the appropriate context is available. For example:
- For order-related variables:
{% if order %} {{ global_vars["store_discount_rate"].value }} {% endif %} - For customer-related variables:
{% if customer %} {{ global_vars["customer_loyalty_points"].value }} {% endif %}