From Workflow - Check if People and Groups group contains members

  • 9 August 2016
  • 6 replies
  • 19 views

Badge +11

Prior to sending an approval request from a workflow to a People and Groups group, I'd like to check that the group has members. How would I do this using worklfow actions?


6 replies

Userlevel 5
Badge +14

is it sharepoint group?

then you will have to use UserGroup.asmx webservice, method  GetUserCollectionFromGroup might be one that you need to call

https://msdn.microsoft.com/en-us/library/websvcusersgroups.usergroup_members.aspx

Badge +11

So I successfully brought back the xml code into the 'Call Web Service' action during a 'Run Now'. I can't work out how to place that xml code into a variable so that I can parse it. 

192048_pastedImage_2.png

How do I get the result back for parsing? I need the Names in the group. 

192049_pastedImage_3.png

And when I attempt to Specify Elements it doesn't go down past GetUserCollectionFromGroupResult. And I get an error when trying to capture the m:GetUserCollectionFromGroupResult

(ERROR: Failed to invoke web service. 'undefined/undefined:m:GetUserCollectionFromGroupResult' has an invalid token.)

Failed to invoke web service. 'undefined/undefined:m:GetUserCollectionFromGroupResult' has an invalid token.

192051_pastedImage_5.png

Userlevel 5
Badge +14

let to return it default value.

then use Query XML action to parse returned result (varGroupUsers variable).

xpath like this should give you Names

/defaultNS:GetUserCollectionFromGroup/defaultNS:Users/defaultNS:User/@Name
Badge +11

Hi Marian

That's what I did. varGroupUsers is always empty after calling the web service. Not sure why. 

Also, there are many names in the group, so I'd like to get them all back somehow into a collection variable.

Userlevel 5
Badge +14

do you have anything configured in 'Result processing'? - leave it empty

what's the data type of varGroupUsers variable? - should be multiline text

try to setup error handling and mail error message to yourself whether there is not an error reported from webservice call.

Badge +11

multiline text was good information. Found the following link that explained it all clearly.

How to Get All the Users From a Specific SharePoint Group Using NINTEX Workflow 

Reply