1. Home
  2. Docs
  3. User Manual
  4. Changesets
  5. Variables

Variables

Variables are attributes that you can specify in the properties of action. InProd automatically replaces these variables with actual values based on the environment. So, for a different environments, the same variable can be used differently without making any changes.

Variable Resolution Order

The variable resolution order starts from the bottom and moves upward.

Variable Resolution Order

If you set Changeset variables through API, InProd uses those variables first. After that, InProd looks for the variables defined in Changesets. In Changeset, it looks for the variables defined for the targeted environment otherwise, it looks for variables defined in any environment.

Finally, InProd looks for the environment variables. Again, in environment variables, it looks for the variables set for the targeted environment, or else it looks for the variables defined for any environment.

Changeset variables

Changeset variables are an extremely versatile feature. One of the most common use cases is to enable a Changeset to traverse multiple environments, catering for the environmental differences, without any modifications to the Changeset along the way.

Any Changeset parameter or contents of a query can be replaced with the variable token which is a square brace and two question marks and space [?? name ??]. Here we have created a variable that has the name of ‘name’.

For added flexibility, the variable can have text both before and after the variable. Care must be taken to ensure there are no unwanted spaces that could cause unexpected behavior.

In the above example, you can see the query parameter is using a variable (name) to determine one of the query conditions. One of the goals here is to match different objects that have inconsistent names between each environment.

Variables can then be defined on the Changeset for a given environment, meaning the value will change depending on which environment the Changeset is targeted towards. The environment of * All * is a catch-all, used for the situation when a specific value for the current environment has not been set.

Changeset Variables

Environment Variables

Within the Admin menu, there is the capability to create environment variables. This is helpful for situations when you desire to define conventions, such as a naming convention. When the Changeset finds a variable, it will search for the value in the following order:

Environment based Changeset variables
  1. Changeset variable set on the targeted environment
  2. Changeset variable set for * All * environments
  3. Environment variable set on the targeted environment
  4. Environment variable set for * All * environments
  5. Variable set by an API call (for automation use cases)

Current Object Variable

There is a system variable called current_object which has access to the values of the object as it is before the current Action is applied. Of course, this only applies to Update Actions. The current_object variable can access most parameters including Annex and Options.

The syntax is [?? current_object.name ??]. Annex and Options need to include the section and key [?? current_object.annex.section.key ??]. If the section or key contains dots, they can be escaped with a leading slash (.)

The main use case is for updating MCP Application options where the objects Dbid value is required.

How can we help?