Creating variables
To preserve variable capacity and reduce administrative overhead, follow these best practices when creating DaVinci variables.
Reuse variables when possible
Your environment can contain up to 100 variables. To limit the number of redundant variables in your company, before creating a new variable, review the Variables tab to see if a variable has been defined for the value that you need. If a variable exists and satisfies the flow requirements, you can reuse that variable in your flow.
When reviewing existing variables for reuse:
-
Read the Name and Description fields to guide you to potential matches.
-
Confirm that the Context, Data Type, and Value parameters work for your flow design.
-
Click Edit on a variable to review its Mutable, Min, and Max configurations.
Flow instance variables are always safe to reuse. |
Standardize your variable names
To help flow builders quickly identify which variables pertain to their desired values, standardize your variable names and description requirements, and then communicate these standards to all DaVinci stakeholders. You can define standards for individual variables or variable categories.
You can find examples of standardized variable names in Common flow variables.
Choose an appropriate variable context
To allow a variable to be used in as many flows as possible, select the most general context that applies to the purpose of the variable. Variable contexts apply as follows:
- Company Context
-
With this context, the variable has one definition for all flows and users. Consider selecting Company Context for variables that represent your company name or a company-wide ID.
- User Context
-
With this context, the variable has a separate value for each user. Consider selecting User Context for variables that represent user-specific data, such as a user ID or status.
- Flow Instance Context
-
With this context, the variable’s value can be set upon execution of a flow that contains the variable, and that value is unique to the containing flow. The variable can also inherit a value from the Variables tab, if no value is set by the execution of the its containing flow.
Consider selecting Flow Instance Context for variables that represent information that might change from one flow execution to the next (even for the same user), such as a time value.
- Flow Context
-
With this context, the variable is tied to a specific flow and has a persistent value. This value is set by the latest of either an execution of its containing flow or an update to the Variables tab. Consider selecting Flow Context for variables that represent values that are common to all users within a flow, such as a task ID or task-related information.
For more information on variable context, see Variables.
Use secret variables for sensitive information
Some values, such as API keys, client secrets, and access tokens, are required for some flows to function but should not be readily visible. You should store these values in secret variables.
Secret variables are a type of company context variable. Their values can be used in the HTTP connector’s Make REST API call capability, in the Headers and Body Parameters sections. Their values are not visible in logs, analytics, API queries, flow JSON files, or to other DaVinci administrators. Administrators can replace the value for a secret variable, but they cannot view the current value after it’s been saved. Saving sensitive values in secret variables makes them more secure and simplifies administration by putting all of the values in one place rather than in multiple connector configurations.
Learn more in Variables and Adding a variable.