Custom variables
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.
Custom variables are created and set in the Solution Settings page in Jigx Management and consist of a variable name and a variable value.
- Select the Custom tab.
- 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.
- Next, type the variable value in the text field.
- 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.
Custom variables are expression based, meaning you can use it wherever expressions are configurable. To reference the variable, the following expression is used:
Replace variableName with the custom variable name you set in Management > Solution Settings.
- 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.