top of page

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

Introduction

In this article you will see how to get all the users from a specific SharePoint group using a NINTEX workflow. We will be getting all the users from a specific SharePoint group by calling the web service "_vti_bin/usergroup.asmx". I have created a custom list named "User Collection" in which I have the following columns.


Workflow Design


Call web service action is used to get the user collection from a specified SharePoint group. Query XML action is used to query the XML and get the login name of the users. Set field value action is used to set the users to the field in the item.

Get User Collection

Use the following procedure to get a user collection from a group workflow:

  • Navigate to the User Collection list.

  • Click on the "List" tab and then click on "Workflow Settings".

  • Click on "Create a Workflow in Nintex Workflow".


  • Click on "Cancel".


  • Drag and drop the Call web service action from the Integration section.


  • You will be able to see the warning symbol in the workflow action, click on that and then you will see the following warning message:


  • Click on "Configure" from the drop down list in the Call web service action.


  • Click on the "Insert Reference" button for the URL column and then click on the "Common" tab. Select "Web URL" and then click on "Ok".


  • Append "/_vti_bin/usergroup.asmx" to the URL column.

  • Enter the User Name and Password to call the web service and then click on the "Reference" button.

  • Click on "Ok".


  • All the web service methods will be populated. Select the "GetUserCollectionFromGroup" web method that will be used to get all the SharePoint groups from the website.


  • Click on the "Variables" button.


  • Enter the variable name and select the variable type.


  • Click on "Save".

  • The variable is created successfully.


  • Click on the "Insert Reference" button for the groupName column and then click on the "Item Properties" tab. Select "Group Name" and then click on "Ok".

  • Select "Specify elements", click on the "m:GetUserCollectionFromGroupResult" element and then click on the "Apply" button.


  • Select the userCollectionXML variable for the "Store result in" drop down.


  • Click on "Save".

  • Drag and drop the Query XML action from the Integration section.


  • Click on "Configure" from the drop down list in the Query XML action.

  • Click on the "Variables" button.


  • Enter the variable name and select the variable type.


  • Click on "Save".

  • The variable is created successfully.


  • Select "XML" from the XML Source drop down list.

  • Click on the "Insert Reference" button for the XML column and then click on the "Workflow Variable" tab.

  • Select "userCollectionXML" and then click on "Ok".

  • Enter the XPath "/defaultNS:GetUserCollectionFromGroup/defaultNS:Users/defaultNS:User/@LoginName".

  • Select the "users" variable from the "Store result" in the drop down list.

  • Click on "Save".


  • Drag and drop the "Set field value" from the "Libraries and lists" section.


  • Set the value to the field.


  • Click on "Save".


Publish the workflow

  • Click on the "Publish" button in the ribbon interface.


  • Ensure the "Title" is set; optionally you can set the values for Description and Change Comments.


  • Click on the "Submit" button.


  • The workflow is published successfully.


Test the workflow

Use the following procedure to test the workflow:

  • Navigate to the User Collection list.

  • Create a new item.


  • Select the item and then click on "Workflows" in the ribbon interface.


  • Click on the "GetUserCollectionFromGroup" workflow and then click on the "Start" button.


  • After a few minutes the workflow status will be changed to "Completed".

  • All the user's login name from the Vijai Owners group will be updated in the list item field as shown below.


Summary

Thus in this article you saw how to get all the users from a specific SharePoint group using a NINTEX workflow.

Related Links

0 comments

Comments


bottom of page