How to Delete Site Using NINTEX Workflow in SharePoint

In this article you will see how to delete a site using NINTEX workflow in SharePoint.

Introduction

In my previous article you saw how to create a site using NINTEX workflow in SharePoint 2010. In this article you will see how to delete the site using the NINTEX workflow in SharePoint. I have created a custom list named "Site Provisioning" in which I have the following columns:

SharePoint-1.jpg

The Title column specifies the site title and description column to specify the site description and Delete is a Boolean value to specify whether the site must be deleted.

Create of site deletion workflow

The following is the procedure for creation of the site deletion workflow:

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

    SharePoint-3.jpg

  5. Drag and drop the "Run if" (used to check if the "Delete" column has a yes value then only the "Delete Site" action will be executed) action from the "Logic and flow" section.

    SharePoint-4.jpg

  6. Drag and drop the "Delete Site" action from the "Provisioning" section.

    SharePoint-5.jpg

  7. Click on "Configure" from the drop down list in the "Run if" action.

    SharePoint-6.jpg

  8. Set the condition as shown below.

    SharePoint-7.jpg

  9. Click on "Configure" from the drop down list in the Delete site action.
  10. Click the on "Insert Reference" button for the "URL name" column and then click on the "Item Properties" tab. Select "Title" and then click on "Ok".

    SharePoint-8.jpg

  11. Click on "Select a parent site" link to select the parent site from where the site must be deleted.

    SharePoint-9.jpg

  12. Click on "Save".

    SharePoint-10.jpg

  13. Click on "Workflow Settings" in the ribbon interface.

    SharePoint-11.jpg

  14. Enter the "Name" and select the check box for "Start manually".

    SharePoint-12.jpg

  15. Click on "Save".

Publish the workflow

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

    SharePoint-13.jpg

  2. Ensure the "Title" is set; optionally you can set the values for "Description" and "Change Comments."
  3. Click on the "Submit" button.

    SharePoint-14.jpg

  4. The workflow is published successfully.

    SharePoint-15.jpg

Test the workflow

  1. Navigate to the "Site Provisioning" list.
  2. Edit the item (for the following item I have already run the Create Site workflow as mentioned in my previous article and the site is created) and select "Yes" for the "Delete" column.

    SharePoint-16.jpg

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

    SharePoint-17.jpg

  4. Click on "Delete Site" workflow and then click on the "Start" button.

    SharePoint-18.jpg

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

    SharePoint-19.jpg

  6. The Site is deleted successfully.

Summary

Thus in this article you have seen how to delete a site using NINTEX workflow in SharePoint.