Connection variables
Connection variables are values stored as labeled references in a particular Nintex Apps connection. These key-value pairs are often used to store protected information unique to a connection, like credentials and database URLs. All variables are stored in a centralized location within the connection's settings and can be deployed across different environments. When an application and its connections are deployed to another environment, the connection variables will be moved, but the values will not. This allows the values to differ in each environment.
Why use connection variables?
It's common practice to develop in one environment, like a sandbox, and then deploy to another, like a production environment. When deploying to the next environment, some values are intentionally not sent because they are secret (like passwords) and others may need to be different (like database URLs). And even for values that are not protected, their settings would be overwritten during each deployment. In these examples, it would be better to have unique values for consistent placeholder references, instead of static values.
Enter connection variables. By defining the necessary variables in each connection, you'll only need to enter them once and change them only if their values change. By setting some fields to reference variables using merge syntax, instead of hard-coded values, you won't have to re-enter those field values each time you deploy to another environment. If the variable names match across environments, then their unique values are injected based on the environment's configuration.
For more information, see Deployment.
Example use case
A common workflow within Nintex Apps could look like this:
- Within a sandbox environment, create connection variables for the username and password for a sandbox database, but whose variable name matches the production variables exactly.
- Within the sandbox environment, create a connection that—instead of hardcoded values—uses the previously created connection variables for its username and password credential fields.
- Within a production environment, create connection variables for the username and password for a production database.
Development would take place in the sandbox environment. When deployed to the production Nintex Apps environment, the connection would function as expected, but pointed to the production database, because the environment names matched. Without using this variable-based workflow, credentials would need to be hardcoded and updated at the connection level in both environments.
Manage connection variables
You can create, edit, and delete connection variables to use in different deployed environments.
-
Create a connection. For more information, see Create a connection.
Note:If you have already created the connection, go to the Connections page and select Apps to display connections associated with apps. For more information, see Connections page. Open the connection using one of the following options:
-
Click the connection.
-
Next to the connection, click
, and click Edit.
-
-
Under Variables, click Add a variable.
-
Type the variable Name.
Note: The name can contain only alphanumeric characters, underscores, or dashes. Do not use spaces.
-
Select the Value type.
The following options are available:
-
Standard: You can view the variable’s value in the UI. Nintex Apps stores standard variables as plain text.
-
Secret: Nintex Apps hides the variable’s value in the UI and stores it in an encrypted form. The value is used securely through the proxy. Use secret variables for sensitive information such as passwords. Once you create a secret variable, Nintex Apps masks its value, and you cannot reveal it again, even when you edit the variable.
-
-
Type the variable's Value.
-
Type a Description for the variable.
-
Click Save.
Any connection fields that reference the variable are updated to use the newly created variable.
Note: If a "Value required" message appears next to an existing variable’s name, you must edit it and add the value.
-
On the Connections page, select Apps to filter the list and display only connections associated with apps. For more information, see Connections page.
-
Open the connection using one of the following options:
-
Click the connection.
-
Next to the connection, click
, and click Edit.
-
-
Under Variables, next to the variable, click
, and select Edit. -
Edit the fields as necessary. If the variable's value type is set to Secret, Nintex Apps masks the value in the UI. You can still edit it, but you cannot view or unmask the existing value.
-
Click Save.
Any connection fields that reference the variable are updated to use the newly edited variable.
-
On the Connections page, select Apps to filter the list and display only connections associated with apps. For more information, see Connections page.
-
Open the connection using one of the following options:
-
Click the connection.
-
Next to the connection, click
, and click Edit.
-
-
Under Variables, next to the variable, click
, and select Delete. -
To confirm deletion, click Delete.
Use connection variables
Variable values are securely injected by the proxy wherever the {{$Connection.<variable name>}} merge syntax is used in the connection (for example, in the URL/endpoint). Secret variable values are not exposed to the client. Variables are deployed with the connection, but values are not.
-
Create a connection or navigate to an existing connection with connection variables. For more information, see Configure authentication and Create a connection variable.
-
In fields where variables are accepted, complete one of the following actions:
-
Select a connection variable that you already created.
-
Insert the {{$Connection.<variable name>}} merge syntax.
-
Paste a copied existing merge variable. To copy an existing merge variable, navigate to the connection with the connection variable, click the Variables tab, click More options next to the variable that you want to copy, and select Copy merge variable. You can also copy a merge variable while editing it.
-