Relevant to both Nintex Workflow 2013 and Nintex Workflow for 2010.
In this article, we show you how you can design a workflow which dynamically selects a set of approvers from another list.
Create a Custom SharePoint list
- Navigate to the library in which the workflow will be created and add a custom SharePoint list.
- In the Nintex Workflow Ribbon, click on Create Column and create the following columns.
- Title: Single Line of Text
- Approver: Person or Group
Populate the List with Two Users
Click on New item. Enter a Title and an Approver, click Save. Repeat, and add a second user.
Create a New Workflow
Navigate to the library where the workflow will be created. In the Ribbon, select Workflow Settings and click on Create a Workflow in Nintex Workflow. Select the blank template and click Create.
Create two variables
- In the Workflow Settings drop down, click on Variables.
- In the Workflow Variables dialog box, select New.
- In Name, type “Approvers” and select Collection as the type, click OK.
- Select New. In Name, type “ApproversString” and select single like of text as the type. Click OK.
The workflow will be configured to query the Approvers list and store all the users in it in the “Approvers” variable, then process it and store the result in the “ApproversString” variable.
Add a Query List action
Drag a Query List workflow action onto the design canvas. Double-click on the Query list action to open the configuration dialog.
Ensure that the Editor mode is set to Query builder.
- In the List drop-down menu, select the List created earlier- in this example Dynamic number of approvers.
- In the Field drop-down, select Approver, and click Add. In the Approvers drop down, select Approvers.
- Select Save. The results returned by the query will be stored in the “Approvers” variable.
Process the data returned by the Query List action
Drag a Collection Operation workflow action on to the design canvas. Double-click on the Collection operation action to open the configuration dialog.
- In the Target collection drop-down menu, select Approvers and then select Join as the type of Target collection.
- In the Delimiter section, enter a semi-colon (;). In this case we use a semi-colon, the regular method of separating lists of users. We will then have a string created that will look something like this: Result1; Result2; Result3
- In the Store result in drop-down menu, select ApproversString.
Add a Request Approval action
Drag the Request Approval workflow action on to the design canvas. Double-click on the Request Approval action to open the configuration dialog box.
- In the Approvers section, click on the Lookup icon. Expand the Lookup section and locate the ApproversString variable.
- Click Add and then OK.
- Customize the notification message and options as required.
Now you can continue and complete the workflow as required. When published, all users in the Approvers list at the time the workflow is executed will be selected as approvers in the workflow.