Variables

Use variables to store and manipulate data in your workflow, such as an email address, file, calculated value, or information collected via a form. You can define, use, and update them as many times as you need throughout your workflow.

For example, you could create a variable to store an employee's email address. The email address is retrieved from a SharePoint list using a workflow action when the workflow runs, and then used to send an email to that employee using another workflow action. By using a variable, you avoid having to specify the email address in your workflow design, making your workflow much more flexible and powerful.

To view a list of all variables that you can use in your workflow, access the Variables pane in the Workflow designer.

 

Variable Type Description Method Create from Usage
Workflow Data to use in the workflow Manual
  • Action configuration panel
  • Variables panel
  • Workflow
  • Form
Form-based task Data entered into the form that is part of a Form-based task Auto-generated
  • N/A
  • Workflow
Start event Data from the workflow start event Manual and auto-generated
  • Start event configuration panel
  • Variables panel
  • Workflow
Context Data from the current workflow instance Auto-generated
  • N/A
  • Workflow
  • Form
Workflow object Data from Connector actions Manual based on Connector output
  • Action configuration panel
  • Workflow
  • Form

Variable types

There are different types of variables available in Nintex Workflow Cloud. They are available in different tabs of the Variables panel to be used in your workflow as required.

  • Workflow variable
  • These variables are created by the workflow designer to store values for use in actions within the workflow. They might be a value used in a configuration field, such as a date or email address, or a value created by an action, such as a calculation result. These variables are available in the Workflow tab of the Variables panel. See Create a variable.

  • Form-based task variable
  • These variables capture data that are entered in forms as part of a Form-based task. The following form-based task variables are generated automatically when you configure the Form for the action:

    • Form variables - Variables that correspond to controls that you add to a form. Form variables contain the information submitted when a user completes a form or task.

    • Form URL - A variable that contains the URL to access the form.

    • Task name (Form link) - A variable that contains a hyperlink to the form URL using the Task name.

    These variables are available in the Form-based task action tab of the Variables panel. This tab is only displayed if a Form-based task has been configured for the workflow.

  • Start event variable

    These variables capture data from the workflow start event. You can use these variables to reference data available in the associated start event. These variables are available in the Start event tab of the Variables panel.

  • Context variable

    These variables represent data that are related to the current workflow instance An occurrence of a workflow. and are automatically populated when the workflow runs. For example, variables that capture the date and time the workflow started. These variables are available in the Context tab of the Variables panel.

  • Workflow object variable

    These variables are output variables of workflow Connector actions. Use the data in other actions of your workflow or in task forms. For example use the output variable of one action in your workflow as the input variable for another action. In task forms, you can use the data to populate a control, or you can drag and drop the variable on the designer canvas to display the data in your form. You can also use these objects in form rules and formulas. See Workflow Objects for more information about using them in a form.

Variables with null value

A variable with null value is empty and has no value. When a connector supports null values, you may need to set the variable to have a null value. You can set the value of the variable to null when creating the variable or using the Set a variable value action.

Create a variable and set the value to null

  1. On the Workflow designer toolbar, click Variables to open the Variables panel or click +Insert from the configuration panel of an action.

  2. Click Create variable.

  3. Specify the Name and Type of the variable.

  4. In the Default value field, click and select Set value as null.

  5. Click Create.

Set value of an existing variable to null

  1. On the Workflow designer toolbar, click Variables to open the Variables panel or click +Insert from the configuration panel of an action.

  2. Hover over the variable you want to edit, click and select Edit.

  3. In the Default value field, click and select Set value as null.

 

Data types

All variables have a data type that determines what kind of values it can store, such as a date, a number, a file path or a piece of text. Configuration fields also have data types they accept. You can only add a variable of an accepted data type into a configuration field.

For example, if you want to insert an email address into a configuration field and the configuration field only accepts Text variables, then you must create a variable of Text type.

Data Type Description Optional default value The default value given to the workflow variable when the variable is used within the workflow. Set value to null
Text Text string. This type of variable can be used to store information such as an employee name, username, or any other string. Yes Yes
Decimal Numerical values with a decimal point. Yes Yes
Integer Numerical with no decimal point. Yes Yes
Boolean Yes or No. Yes Yes
DateTime A date that's combined with the time. YYYY-MM-DD, HH:MM AM/PM. Yes Yes
File

Path to a file within a file storage system. A file path must start with the root folder and end with the file name. For example, /Draft/Contracts/ACME.docx.

No No
Collection

A variable that groups one or more variables of the same type into an ordered list. For more information, see collection actions Collection operations actions. For example, a collection variable named Company name can hold a list of names, such as Safalo, Nintex, and Drawloop.

No No
Object

A variable that groups several variables of any type into a hierarchical structure. Objects can contain other Objects.

For example, an Object variable named Company can hold a list of fields such as company name, email, address, and phone number.

Note: Objects are created by actions. They can't be created or modified in the Variables panel.

No No
Collection of Objects

An ordered list of objects with the same variable structure.

For example, Companies is a Collection of objects variable. It holds an ordered list of Company details objects for the companies Safalo, Nintex, and Drawloop. Each Company details object holds several fields detailing the company name, email, address, and phone number.

Note: Collections of objects are created by actions. They can't be created or modified in the Variables panel.

No No

Create a variable

You can create variables from:

  • The action configuration panel, when you're configuring a workflow action.
  • The toolbar of the workflow designer.
  • The start event configuration panel when you're configuring the start event.

Use variables in your workflow

In the Action configuration panel, you can use one of the following methods to insert a variable into a field that accepts variables. Not all methods are available for all fields.