How to retrieve users from multiple SharePoint Groups using K2

by | Jun 14, 2016 | BlogPosts, K2, Sharepoint, Tech Tips | 0 comments

Here’s a very quick how-to for those developers using K2 who may find themselves required to extract users (such as Administrators) from multiple SharePoint groups. An example in which you may need to do this is if a developer is required to display a list of users to another end user.

This can be achieved by using the ‘Get Users in Groups’ method from the Sharepoint Groups Service Instance within K2, under the Sharepoint Functions Broker. The screenshot below outlines this.

2016-06 Blog - Get Users in Group from SP - Image 1

However, you might find it tricky to use the parameter Group Name. This is because it’s XML; the developer would need to know the exact XML syntax. The Group Name parameter is in fact expecting XML in the format of:

<Groups><Group Name=”your group 1″/><Group Name=”your group 2″></Groups> (jsut needs to insert the groups).

Simply replace “your group 1” and “your group 2” and so on with the names of the SharePoint groups you are retrieving users from when executing the SmartObject. This can be seen in the screenshot below.

2016-06 Blog - Get Users in Group from SP - Image 2

Hopefully this was helpful. If you want to get updates on more regular how-to’s, why not subscribe to our blog?

In the meantime, keep an eye out for more K2 blog updates.

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *