Add Users To SharePoint Group Using Nintex Workflow 2016 And Web Service

SharePoint 2016 general availability had been announced in the Future Of SharePoint conference in May 2016. The series that discusses the installation of SharePoint 2016 in Azure can be found at C# Corner from the below links,

Nintex is a premium technology partner for SharePoint. With the announcement of SharePoint 2016, Nintex has made the announcement of the general availability of Nintex Workflow 2016 in July 11th 2016.

In this article, we will see how to add users to SharePoint Groups by maintaining a user configuration list and using Nintex workflows. As a prerequisite, create ‘SharePoint Users’ configuration list.



Add the below columns. Ensure creating ‘User’ and ‘Group’ columns as they will be used in the workflow.



Let’s go ahead to the primary list where we will be running our Nintex Workflow. In our case, it is the ‘User Profile’ list. Select ‘Create a Workflow in Nintex Workflow’.



This will open up the designer form. Add the web service action on to the form.



Once the action is added, it will show the condition missing warning.



Configure Web Service

Now, we have to configure the web service action.



The configuration form will look like the below.



The web service URL will be created by fetching the Web URL from the workflow variable and appending “/_vti_bin/usergroup.asmx” to it.



Specify the user name and password that will be used to connect to the web service, preferably the site collection administrator.



Click on OK.



Now, we have to mention the web method which is ‘AdduserToGroup’ in our case.



We have to assign a couple of other parameters which will be used by the web service. In order to do that, fetch the values from the SharePoint List so that it can be assigned dynamically during run time. Click the browse button, next to groupName field, and select the list item field ‘Groups’ from Item Properties tab.



Similarly, for username, userLoginName, and userEmail ,assign List Item field ‘User’ from the Item Properties tab.



Eventually, the configuration form will look like the following.



The designer form will look like the below image.



Now, set the workflow triggering condition. Click on workflow settings.



Here, we are setting it to ‘Start when items are created’ so that the workflow triggers on item creation.



Publish the workflow.



Specify the workflow name and description, and Submit.



The workflow has been published.



Let’s head over to the Configuration List and add a new item.



This will trigger the workflow. The status can be verified from the workflow column ‘Add User to Group’.



Checking the ‘Employee’ group, we can see the new user addition.



Summary - Thus, we saw how to add users to SharePoint 2016 Group, using Nintex Workflow 2016 and UserGroup.asmx web service.