How to determine if Created by exists in SP group

  • 9 April 2018
  • 5 replies
  • 12 views

Badge +3

In one of our workflows, I want to determine whether the Created by person is in the TimeOffApprovers SP group. If yes, follow one branch, if no then a different branch. I tried to Set a Condition where Condition: Created by a specific person, but that went nowhere quick. Couldn't find any viable options in there. Any ideas? Thanks in advance.

There are 8 people in this SP permissions group, for what it's worth.


5 replies

Userlevel 5
Badge +14

you will need to make a call to userGroup.asmx web service to get all the group members (GetUserCollectionFromGroup method) or to get all the groups which's the user is meber of (GetGroupCollectionFromUser method).

https://msdn.microsoft.com/en-us/library/users+and+groups.usergroup.getgroupcollectionfromuser%28system.string%29%28v=office.12%29

based on that you should be able to decide  which branch to continue.

Badge +3

Thank you for the reply. The link you provided generates a 404 error.

I used this method: https://wowsomuch.com/sharepoint/nintex-checking-if-a-user-is-a-member-of-a-sharepoint-group/

This appears to be exactly what I am looking for. However, the workflow errors at the Action Set with the following:

Failed to invoke web service. Error returned from server: <soap:Fault xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><faultcode>soap:Server</faultcode><faultstring>Exception of type 'Microsoft.SharePoint.SoapServer.SoapServerException' was thrown.

Userlevel 5
Badge +14

seems to be something broken at MS side...

direct links to webservice methods work, but webservice main page from above doesn't

UserGroup.GetUserCollectionFromGroup Method (WebSvcUserGroup) 

UserGroup.GetUserCollectionFromWeb Method (Users and Groups) | Microsoft Docs 

Badge +3

Resolved. This article describes how to do this, step-by-step: https://wowsomuch.com/sharepoint/nintex-checking-if-a-user-is-a-member-of-a-sharepoint-group

Badge

Do you have any workaround same for sharepoint online? as this solution does not work for SP online.

Reply