Skip to main content
Nintex Community Menu Bar

Get all users from multiple SharePoint groups and add to single collection

  • May 7, 2020
  • 2 replies
  • 20 views

Forum|alt.badge.img+1

Is there a way to loop through the GetUserCollectionFromGroup web service operation and get all the users in multiple groups?   

 

I need to get all users into a single collection and build one string with them all in, then remove any duplicates.

2 replies

Forum|alt.badge.img+12
  • Scholar
  • May 8, 2020

@spenney ....try below steps:

 

  1. Use the web method "GetUserCollectionFromGroup"
  2. In web service output option, select "Specify elements"
  3. Expand everything in soap:Body and select "m:GetUserCollectionFromGroupResult
  4. Store the output in multi-line text variable, output is the XML file
  5. Using Query XML action, use above MLT variable as a source
  6. Use "/defaultNS:GetUserCollectionFromGroup/defaultNS:Users/defaultNS:User/@LoginName" XPath if you want logins or "/defaultNS:GetUserCollectionFromGroup/defaultNS:Users/defaultNS:User/@Name" to get names.

You can also get test XML from web service and use that to see what you want using XPath builder.


Forum|alt.badge.img+1
  • Author
  • May 12, 2020
Thanks kunalpatel

I was missing a join collection after the XML builder. Once the collection was joined I could then concatenate all the users into one string in order to count and de-duplicate them.