To check if item modified by one of the list of people - SharePoint 2010

I was working on one of the approval workflow which has to fire a mail based on the condition that if the current item is modified by one of the users from a SharePoint list.


This seemed an easy condition to work on and I had two different approaches, so I was pretty confident.

Prerequisites: - Create a group for your approvers in this case “Approvers

  • Use “Modified by a specific person” condition which checks user by People/Group from SharePoint site.



OR

  • Use “If any value equals value” condition which checks If current Item Modified by equals user from People/Group from SharePoint site

But I got surprised when none of the efforts worked. Don’t know why, my workflow was unable to pick users from my group.

And i was even surprised when google search could not give me a reason of this behavior and MSDN keeps explaining that it will work properly.

An alternate solution could be to write code for this, which was not a very wise, so I decided to do it by designer only and started looking for alternate ways. Bingo!!! I got an article which showed the workaround, which explains it as follows :-


Must Read : Buddhu Logger


  • Create a SharePoint list in this case “Approvers_List” and add a new column named “Approver” which should be of Person or Group type. This will hold all the approvers (Users) that we need for workflow to look into and will work as people picker while adding users.


  • You can choose the default tittle column to be empty. While inserting users. This list should contain all the users which you want as approvers.


  • Now open your workflow and add a “If any value equals value condition”. In first value condition use “Current Item : Modified By” operator should ne “Not Equals” and second value condition should use “Workflow Lookup for a user”.


  • Now click on Add button as shown in image below. It will open a Lookup for Person or Group Popup. In Field data to retrieve section ( top three boxes)  Data Source should be your SharePoint list in this case “Approvers_List” . Filed Name should be the user column in the list, in this case “Approver”, select Return field as: Display Name.


  • In Find the List item section ( last two boxes) Field should be “Approver” and Value should be “Current Item:Modified By”. Everything should exactly be filled as the image below.


  • If everything is followed correctly your if block will exactly look like the image below.


  • Save and publish workflow, It will work as expected.

Hurrey !!!! Enjoy.

Thanks for your comment