Nov 9, 2013

SharePoint 2013 Approval Workflow With Dynamic Approvers From Another List

In this article, we will create a simple approval workflow in which approver is selected dynamically from another list using Sharepoint Designer 2013. We will implement the following approver hierarchy:

approver hierarchy

In a document library, if User1 or User2 creates any document then it will be approved by Manager1. Similarly, Administrator will approve documents created by Manager1 and Manager2.

Video:

Here is the full video tutorial:

Creating Approver List:

To define the approver for the user, we create a list.

Click “Settings” icon > Add an app > Custom List
Enter Name “Approver Info” > click Create

Open “Approver Info” list
In Top Ribbon List > List Settings
Click “Title” in Columns and rename to Department > OK
Click “Create Column” and enter following information
Name: “Editor
Type: “Person or Group
Require that this column contains information: Yes
Allow multiple selections: No
Allow selection of: People Only
Choose from: All Users

Similarly create “Approver” column and enter data.

approver hierarchy

Creating Workflow:

1. Open Document Library > In Library Ribbon: Workflow Settings > Click “Create a Workflow in Sharepoint Designer”
2. Click “Allow”, It will open Sharepoint designer, Enter Name “Approval Workflow” and description > OK

approver hierarchy

3. In Workflow Ribbon > Action > “Set Workflow Status” > Enter “Pending”
4. just below of this action, add new action “Set Workflow Variable
click “Workflow Variable” > “Create a new variable” > Set Name “Approver” and Type “String“.
click value > click function icon > set following values:

Find Data to Retrieve:
Data source: Approver Info
Field from source: Approver
Return field as: Login Name

Find the List Item
Field: Editor
Value: click function icon > select Datasource : Current Item, Field from source: Created By, Return field as “Login Name”

approver hierarchy

5. just below of this action, add new action > “Start a task process
Click “these users“, click … for participants
Select “Workflow Lookup for a User” > Add
Select Data Source “Workflow Variables and Parameters“, Field from source : Variable :Approver, Return field as: String > OK
OK
Enter Task Title and Description
click OK

approver hierarchy

6. After this action, click Condition > “if any value equals value
click first value, click function icon
Data source: “Workflow Variables and Parameters”
Field from source : Variable : Outcome

click second value, select approved

7. In If condition, Add action “Set Workflow Status” > Enter “Approved”
8. In workflow ribbon > click “Else Branch”, Add action “Set Workflow Status” > Enter “Rejected”
9. below of “Transition to stage”

Add Action > “Go to a stage”
click “a stage” > select “End of Workflow”

Save it. Now the workflow looks like below:

approver hierarchy

10. Click on “Workflow Settings” in ribbon and check “Start workflow automatically when an item is created” in Start options.
11. Publish the workflow.

Filtering Task List:

Now user wants to see their tasks only. So In the view, to display the tasks of the current user only:

Open Task library > List ribbon > List Settings
Click “All Tasks” in Views

In filter section, select “Show items only when the following is true:” and set condition “Assigned to is equal to [Me].

approver hierarchy

When user1 creates any document, A task is assigned to Manager1. When Manager1 approves the request then the status will become approved.

Conclusion:

We have implemented a very simple Sharepoint designer 2013 workflow where approver is defined by another custom Sharepoint list.

Enjoy Sharepoint !!

12 comments

  1. this will be great for capturing the approval. what about capturing various data points (answers to questions) how can I tie this to a SP list/InfoPath form?

  2. Thank you for this article!

    I’m actually in the middle of creating an approval sharepoint however I’m having some difficulties when it comes to the workflows. My problem is that I don’t know how to create these dynamic approval workflows based on more than one condition.

    I have a form for example where the user selects the country and then makes another selection from a drop-down. Is there any way to apply a similar list to my situation – example: the user needs to select France and from a drop down “Lower than $5K” – in this situation the workflow needs to contact one approver; however the approver would be different if they were to select Italy. Would this be done with a lot of “ifs” in Designer?

    Thank you!

  3. I want to create a 3 level approval workflow in sharepoint custom list .when an proposed amount is added to list. please help me to do that….

  4. My scenario is I have dynamic approvers which are being set from 2 columns in the list. I am using assign task process to create task. Business case is user can approve/reject/SendBack. Functionality of sendback is to request for more information. If any user clicks on sendback it will trigger mail to admin requesting more info when user is satisfied user will click on approve or reject. If any user clicks on reject workflow will be rejected completely.

    Any help is appreciated. Thanks in advance

  5. hi i’m trying to do something similar to my sharepoint site just want to know how to link it with the column name in my docs base “Departement”

  6. Thank you, this helped me a lot, and I managed to dynamically choose an approver for an item based on a region. I just have two concerns. One is security – it seems that anyone can approve an item, not just the person to whom the task is assigned. Secondly, is it possible to have Groups as approvers?

  7. if user1 upload a document and its waiting to approve, then user2 can see that document in document lib. (just see not open) ?

  8. Hey this is great and I almost have it working. However, the ‘Rejected’ outcome does nothing…. Even if I only set 1 IF statement, with no Else, and have it look for ‘Rejected’, nothing happens.
    The ‘Task Outcome’ is captured properly on the workflow status screen, it says ‘Rejected’. I also find it weird that Task Outcome is an integer.
    Any suggestions?

Leave a Reply

Your email address will not be published. Required fields are marked *