I want to start workflow,if item is updated by user who is member of specific group in SharePoint.

Suppose my SharePoint user group is "Test", if any member of this group edits my list item, it should trigger Approval workflow.

My workflow is working if I set hardcoded any user's name.But If I set Group Name, its not performing this step and my workflow is getting stopped.I have created SharePoint 2010 workflow.

ScreenShot: enter image description here

  • What error you get when your workflow get stopped? – Sohail Shaikh Oct 11 '18 at 17:44
  • I am not getting any error. but that conditions is not becoming true as may be it is not able to find given Group. – Vishal_chorghe Oct 12 '18 at 5:27
  • Share the screenshot of your workflow where it's not working with the group. – Sohail Shaikh Oct 12 '18 at 5:29
  • @SohailShaikh I have added the sceenshot – Vishal_chorghe Oct 12 '18 at 6:45

Note: This answer only works for 2013 workflows!

It will not work when inserting the group as the group is en entity in itself. In plain words, a group is just another user to the workflow.

I would utilise the REST API and check if a user is a member of the selected group. I don't tihnk there's a specific endpoint for it, but you can hit the group and ask it to return the user, if it can't return the user. The user isn't a part of the group.

The endpoint to do it is this (Run as a GET request):

/_api/web/sitegroups([Group principal Id])/users/getbyid([User principal id))

The principal id of the group can be found in the url when you open the group. The principal id of the user can be returned from the url when you hover the user.

Both id's can be returned from a people field by selected ID rather than Nlogin name.

  • Thank you for this. This might help.I will definitely try this. Please let me know how to use rest call in 2010 Workflow If you have idea. – Vishal_chorghe Oct 12 '18 at 6:34
  • Oh sorry I didn't realise you where using 2010 workflow. Calling webservice is only possible in 2013 workflows – Morten K Oct 12 '18 at 6:35

You could create a workflow variable of type string for the members of the group and if that variable contains the modified by (also converted to string) it should work.

  • Out of curiosity how do you extract the user from the group? – Morten K Oct 12 '18 at 6:26
  • According to you then, I will have to assign all group members to this variable i.e. hardcoded name. but, in future if we make any changes to this group then I will have to update workflow variable also. – Vishal_chorghe Oct 12 '18 at 6:29
  • @MortenK this is what I am not able to perform. If I put my name directly ,then it is working. but if I Put Group Name, I think its not able to extract user from this group – Vishal_chorghe Oct 12 '18 at 6:31
  • Have a look at my answer using the REST API it is indeed possible to validate if a user is a member of a group. – Morten K Oct 12 '18 at 6:32
  • Sorry, my solution doesn't work with a group. I used a list item with a multi person field and converted that to a string. – JJD Oct 12 '18 at 6:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.