How to Add a Group in SharePoint Site Using NINTEX Workflow

Introduction

In this article you will see how to add a group to a SharePoint site using a NINTEX workflow. We will be adding the group to the SharePoint site by calling the web service "_vti_bin/usergroup.asmx". I have created a custom list named "Group Provisioning" in which I have the following columns:

Group in SharePoint

Workflow Design

Workflow Design
 
The Group Exists UDA is a user defined action that is used to check if the group exists. Please refer to the following articles:

  1. How to Check if SharePoint Group Exists Using NINTEX Workflow
  2. How to Create User Defined Action For NINTEX Workflows in SharePoint

Set a condition is used to set the Yes or No value. The Call web service action adds the group to the SharePoint site.

Add Group workflow

  1. Navigate to the Group Provisioning list.
  2. Click on the "List" tab and then click on "Workflow Settings".
  3. Click on "Create a Workflow in Nintex Workflow".

    Workflow in Nintex Workflow
     
  4. Click on "Cancel".

    Blank Workflow in Nintex Workflow
     
  5. Drag and drop the Group Exists UDA action from the User defined actions section.

     User defined actions in Nintex Workflow
     
  6. Click on "Configure" from the drop down list in the Group Exists UDA action.

     Group Exists UDA  in Workflow
     
  7. Click on the "Variables" button in the ribbon interface.

    Variables button
     
  8. Click on the "New" button.

    New button
     
  9. Enter the variable details.

    Variables details
     
  10. Click on "Save".
  11. The Workflow variable is created successfully.

    created Workflow variable
     
  12. Click on "Close".
  13. Enter the Input and Output parameters for the UDA as shown below.

    UDA Output parameters
     
  14. Click on "Save".
  15. Drag and drop the "Set a condition" action from the Operations section.
  16. Click on "Configure" from the drop down list.

    Workflow Configure
     
  17. Set the condition as shown below.

    Workflow Condition
     
  18. Click on "Save".
  19. Drag and drop the "Call web service" action from the Integration section for the true condition.
  20. Click on "Configure" from the drop down list.
  21. 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".

    Workflow Web URL
     
  22. Append "/_vti_bin/usergroup.asmx" to the URL column.
  23. Enter the User Name and Password to call the web service and then click on the "Reference" button.
  24. Click on "Ok".

    Workflow OK
     
  25. All the web service methods will be populated. Select the AddGroup web method that will be used to remove the specified SharePoint group.

    AddGroup web method
     
  26. The Web Service Input section will be populated for passing the input values to the web method.

    Web Service Input
     
  27. Click on the "Insert Reference" button for the groupName column and then click on the "Item Properties" tab. Select the Group Name and then click on "Ok".
  28. Click on the "Insert Reference" button for the ownerIdentifier column and then click on the "Item Properties" tab. Select the Group Owner and then click on "Ok".
  29. Click on the "Insert Reference" button for the ownerType column and then click on the "Item Properties" tab. Select the Owner Type and then click on "Ok".
  30. Click on the "Insert Reference" button for the defaultUserLoginName column and then click on the "Item Properties" tab. Select the Default User and then click on "Ok".
  31. Click on the "Insert Reference" button for the description column and then click on the "Item Properties" tab. Select the Group Description and then click on "Ok".
  32. Click on Save.

Publish the workflow

  1. Click on the Publish button in the ribbon interface.

    Workflow Publish button
     
  2. Make sure the Title is set; optionally you can set the values for Description and Change Comments.

    Description and Change Comments
     
  3. Click on the "Submit" button.

    Workflow Submit button
  4. The workflow is published successfully.
     
     Workflow Publish successfully
Test the workflow
  1. Navigate to the "Group Provisioning" list.
  2. Create a new item.

    Workflow new item

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

    Workflow ribbon interface
     

  4. Click on "Add Group workflow" and then click on the "Start" button.

    Add Group workflow

  5. After a few minutes the workflow status will be changed to "Completed".
  6. If the specified Group Name does not exist in the site then the group will be created successfully in the SharePoint site.

    group created successfully in the SharePoint

Summary

Thus in this article you saw how to add the group to the SharePoint site using a NINTEX workflow.

Related Links

  1. How to Create Site Using NINTEX Workflow in SharePoint
  2. How to Delete Site Using NINTEX Workflow in SharePoint
  3. How to add user to SharePoint group using NINTEX workflow
  4. How to Remove User From SharePoint Group Using NINTEX Workflow
  5. How to Check if SharePoint Group Exists Using NINTEX Workflow
  6. How to Create User Defined Action For NINTEX Workflows in SharePoint
  7. How to Remove Group From SharePoint Site Using NINTEX Workflow