Sivarajan's Blog

SharePoint | Office 365 | Azure | JavaScript

SharePoint 2013 / Office 365 : How to use local variables in Designer Workflow – Part 1

In the previous post, we saw that how to create a helpdesk approval workflow. But we have hard coded task values like below.

27012014-1

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.

27012014-2

  1. Edit the Helpdesk WF workflow with SharePoint designer.
  2. In the Waiting for IT Admin Approval Stage, drag and drop the Set Workflow variable activity from Actions – SharePoint 2013 Workflow
  3. Double click and rename to Local variable : Assigned To = IT Admin
  4. Property gear will be visible on mouse over the Local variable activity and select the Variable menu item in that.
  5. Set Workflow Variable Properties window will be opened.
  6. Select the dropdown next to Variable text in the Set Workflow Variable Properties window.
  7. In the dropdown list, select the Create a new variable menu item
  8. Enter the Name to AssignedTo and Type as String.
  9. Like that, select the button next to Value text in the Set Workflow Variable Properties window.
  10. On click the Add or Change Lookup button, Lookup for String window will be opened.
  11. Fill the following fields like below,

27012014-3

Setting the Title and Description from Helpdesk Request

In the current workflow, all the tasks title will be Please approve this task.

  1. Open an Assign a Task properties.
  2. On click the button next to Title text and the String Builder window will be opened.
  3. On click Add or Change Lookup button in the String Builder window, Lookup for String window will be opened.
  4. Set the Data source to Current Item and Field from source to Title (Note: The current item means that the associated Helpdesk request)
  5. Like Title, repeat the above steps for Description field.

 27012014-4

Now save and republish the workflow.

Test the workflow

While creating a new request, the output of the task will be,

27012014-5

Summary

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.

Add comment

Loading