Premium Checkbox Feature
Usage of this feature requires account access to Premium Checkbox features. For queries related to your licence agreement, ask your account administrator to contact your Checkbox Account Manager.
What is an environment variable?
Environment variables are variable values available to any user within the company environment to reference within an App using a JS API. See below for Instructions to reference environment variables in your Apps.
When should I use environment variables?
Some common use cases for environment variables include (but not limited to) SharePoint domains and API Keys for systems (e.g., Salesforce, payment gateways etc).
How to create environment variables
- Click onto your user name and go to "Account Settings"
- Go to "Environment Variables”
- Click "+ New Variable"
- Enter the details for the new environment variable and select to either show or hide the variable value.
- If “Hide Value” is checked, values will be hidden and replaced with 5 asterisks (*).
- Environment variables with hidden values cannot be edited.
How to reference environment variables
The following instructions will assume you understand how to use the JS block. Learn more about the JS Block.
const A1 = api.env('SharePointDomain’);
Note: A single JS snippet can hold multiple JS API calls to retrieve the unique environment variable values. However, you must ensure that the identifierName, environmentVariableName and outputJSValue are changed respectively. See screenshot of the JS snippet below.
- Drag in a JS Block and upload the JS snippet
- Create an output variable and enter the output JS variable from the JS snippet
Following on from the previous example to retrieve the unique value of the environment variable with the name “SharePointDomain”, set up the JS block as shown in the following screenshot where the output JS variable in the JS snippet is “OutputSPDomain”.
- Reference the Checkbox Variable in your App where necessary.
Following the same example for the “CompanyEmail” environment value, TXT11 (output JS variable generated from the JS Block) can now be referenced in your App. See screenshot below.
What your users will see:
Note: If the environment variables values are hidden,”*****” will be displayed when referenced.