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.
Configure connection variables
You can create, edit, and delete connection variables to use in different deployed environments.
Create connection variables
-
In the top navigation bar or under Resources for your app, click Connections.
-
Create a connection. For more information, see Create a connection. If the connection already exists, click it or click More options next to the connection and select Configure.
-
Click the Variables tab. If you are creating a connection variable for a new REST connection, click Variables under Properties.
-
Click Add.
-
Enter a Name for the variable. The name can only include alphanumeric characters, underscores, or dashes (no spaces).
-
Select the variable's Value type:
-
Standard. The value of the variable will be visible in the UI. Standard variables are stored as plain text.
-
Secret. The value of the variable will not be visible in the UI. Secret variables are stored as encrypted text. It will only be used securely in the proxy. This value type is often used for sensitive information like passwords. After you create a secret variable, the value will be masked in the UI and you will not be able to unmask it, even when editing it.
-
-
Enter the variable's Value.
-
Enter a Description for the variable.
-
Click Save.
Any fields whose values were saved as variables are updated to reference the newly created variable.
Edit connection variables
If a "Value required" message appears next to an existing variable’s name, you must edit it and add the value.
-
In the top navigation bar or under Resources for your app, click Connections.
-
Click More options next to the connection and select Configure.
-
Click the Variables tab.
-
Click More options next to the variable that you want to edit.
-
Select Edit.
-
Modify the fields as necessary. If the value of the variable is secret, it will be masked in the UI and you will not be able to unmask it, even when editing it. You can still edit it, though.
-
Click Save.
Any fields whose values were saved as variables are updated to reference the newly edited variable.
Delete connection variables
-
In the top navigation bar or under Resources for your app, click Connections.
-
Click More options next to the connection and select Configure.
-
Click the Variables tab.
-
Click More options next to the variable that you want to edit.
-
Select Delete.
- Click Delete to confirm.
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). They 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 Create an authentication provider and Create connection variables.
-
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.
-