Administration
...
Solutions
Solution Settings

Custom variables

4min

Defining custom variables enables you to create reusable values that can be dynamically controlled, eliminating the need for hardcoding. This approach offers flexibility, allowing values to be updated instantly and seamlessly applied throughout the app. Custom variables are particularly effective for storing environment-specific values that change over time, such as URLs.

Creating and setting variables

Custom variables are created and set in the Solution Settings page in Jigx Management and consist of a variable name and a variable value.

Custom Variables
Custom Variables

  1. Open Jigx Management, navigate to the solution where the variables will be used.
  2. Select Solution Settings in the left navigation pane.
  3. Select the  Custom tab.
  4. Type a name for the variable in the text field and click the + sign. This creates the variable name, which appears at the top of the field.
  5. Next, type the variable value in the text field.
  6. Click Save in the top right-hand corner.

Now that your variables are set, you can use the variables throughout the solution in Jigx Builder.

Using variables

Custom variables are expression based, meaning you can use it wherever expressions are configurable. To reference the variable, the following expression is used:

YAML


Replace variableName with the custom variable name you set in Management > Solution Settings.

Considerations

  • Do not store API keys, passwords or secrets in custom variables, as they are not encrypted or secure.
  • Variables are solution specific, and cannot be used across multiple solutions.
  • Custom variable values are read only in the mobile app.
  • Best practice is to use custom variables to configure environment variables, relating to:
    • Production, development, or test URLs.
    • Customer preferences, for example, a base solution that is used for mulitple customers, departments, stores. Simply change the variable value to apply to each customer.