In the previous post, we saw that how to create a helpdesk approval workflow. But we have hard coded task values like below.
Dynamic Task Participant Value
In the current workflow, Participant value is IT Admin and this value is hard coded now. In future, if we want to change the user group from IT Admin to Helpdesk IT Admin, we need to edit the workflow.
For avoiding this, I have created list called Helpdesk Config to keep all the configurable variable related to our system. For the current case, I have added entry TASK_APPROVAL_TEAM to IT ADMIN. Site admin can change the approval group at any time.
- Edit the Helpdesk WF workflow with SharePoint designer.
- In the Waiting for IT Admin Approval Stage, drag and drop the Set Workflow variable activity from Actions – SharePoint 2013 Workflow
- Double click and rename to Local variable : Assigned To = IT Admin
- Property gear will be visible on mouse over the Local variable activity and select the Variable menu item in that.
- Set Workflow Variable Properties window will be opened.
- Select the dropdown next to Variable text in the Set Workflow Variable Properties window.
- In the dropdown list, select the Create a new variable menu item
- Enter the Name to AssignedTo and Type as String.
- Like that, select the button next to Value text in the Set Workflow Variable Properties window.
- On click the Add or Change Lookup button, Lookup for String window will be opened.
- Fill the following fields like below,
Setting the Title and Description from Helpdesk Request
In the current workflow, all the tasks title will be Please approve this task.
- Open an Assign a Task properties.
- On click the button next to Title text and the String Builder window will be opened.
- On click Add or Change Lookup button in the String Builder window, Lookup for String window will be opened.
- Set the Data source to Current Item and Field from source to Title (Note: The current item means that the associated Helpdesk request)
- Like Title, repeat the above steps for Description field.
Now save and republish the workflow.
Test the workflow
While creating a new request, the output of the task will be,
In this post, we saw that, how to use local variables inside the helpdesk workflow and we will see how to debug the designer workflow in the next post.