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.
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.
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.