How to Check if SharePoint Group Exists Using NINTEX Workflow

In this article you will see how to check if a SharePoint group exists using a NINTEX workflow.

Introduction

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

GroupName column

The Group Name column specifies the group for which we will check if it exists in the site and the IsGroupExists column specifies the Boolean value.

Workflow Design

Workflow Design

Group exists workflow

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

    Group exists workflow

  4. Click on "Cancel".

    Workflow template

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

    Integration section

  6. You will then see the warning symbol in the workflow action. Click on that and then you will be seeing the following warning message.

    warning symbol in workflow
  7. Click on "Configure" from the drop down list in the call web service action.

    Configure Call web service

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

    Web URL

  9. Append "/_vti_bin/usergroup.asmx" in the URL column.
  10. Enter the User Name and Password to call the web service and then click on the "Reference" button.
  11. Click on "Ok".

    Web Service URl

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

    Variable section in Configure-Action

  13. Click on the "Variables" button.

    GetGroupCollectionFromWeb web method

  14. Enter the variable name and select the variable type.

    Create WorkFlow Variable

  15. Click on "Save".
  16. The variable is created successfully.

    Workflow Variable

  17. Select the groupCollection variable for the "Store result in" drop down.

    groupCollection variable

  18. Click on "Save".
  19. Drag and drop the "Regular Expression" action from the Operations section.

    Operations section

  20. Click on Configure from the drop down list in the Regular Expression action.
  21. Click on the "Insert Reference" button for the Pattern column and then click on the "Item Properties" tab. Select "Group Name" and then click on "Ok".

    Item Properties tab

  22. Select "Check match" for Operation.
  23. Click on the "Insert Reference" button for the Input text column and then click on the "Workflow Variables" tab. Select "groupSelection" and then click on "Ok".

    groupSelection in Workflow

  24. Click on the "Variables" button.
  25. Enter the variable name and select the variable type.

    variable name and select the variable type

  26. Click on "Save".
  27. The variable is created successfully.
  28. Select "isGroupExists" from "Store result in" the drop down list.

    isGroupExists

  29. Click on "Save".
  30. Drag and drop the "Update Item" action from the "Libraries and lists" section.

    Update Item action

  31. Click on "Configure" from the drop down list in the "Update item" action.
  32. Select the following values.

    Update item action

  33. Click on "Save".

Publish the workflow

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

    Publis Workflow

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

    Title and Description in WorkFlow

  3. Click on the "Submit" button.

    Publishing WorkFlow

  4. The workflow is published successfully.

    published successfully

Test the workflow

  1. Navigate to the Group Exits list.
  2. Select the item and then click on "Workflows" in the ribbon interface.

    Workflows in the ribbon interface

  3. Click on the "Group Exists" workflow and then click on the "Start" button.

    Group Exists workflow

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

    workflow status

  5. IsGroupExists will return the Boolean value.

Summary

Thus in this article you have seen how to check if the group exists in 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