How to Create User Defined Action For NINTEX Workflows in SharePoint

Introduction

A User Defined Action is a set of workflow actions that takes input and output parameters that can be used multiple times in the workflow instead of recreating the same logic. This action can be scoped to the site, site collection or farm. The main purpose of creating a User Defined Action is reusability. In this article I will explain how to create a User Defined Action for NINTEX workflows in SharePoint using a very simple example. I have created a custom list named "Names" in which I have the following columns:

NINTEX workflows in SharePoint

FirstName and LastName will be provided by the user and by running the workflow the FullName will be generated.

running the workflow

Create User Defined Action

Use the following procedure to create a User Defined Action:

  1. Navigate to the SharePoint site.
  2. Click on "Site Actions".
  3. Click on "Nintex Workflow 2010" and then click on "Manage User Defined Actions".

     SharePoint User Defined Actions
     
  4. Click on the "Create" button in the ribbon interface.

    SharePoint ribbon interface
     
  5. Click on "UDA Settings" and then click on "Parameters" to create input and output parameters.

    SharePoint User Defined Actions Parameters
     
  6. Click on "New" button.

    New User Defined Actions Parameters
     
  7. Enter the parameter details for First Name and click on "Ok".

    create workflow parameter
     
  8. Similarly create a Last Name parameter.

    create workflow parameter
     
  9. Create the output parameter.

    create new workflow parameter
     
  10. All the input and output parameters are created.

    SharePoint output parameters created
     
  11. Drag and drop the "Build String" action from the Workflow Actions.

    SharePoint Build String action
     
  12. Click on "Configure" from the drop down list.
  13. Insert the workflow variables "[Last Name]", "[First Name]" as shown below and store the result in the output parameter "Full Name".

    SharePoint workflow variables

Publish the UDA

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

    SharePoint Publish ribbon interface
     
  2. Make sure the Title is set; optionally you can set the values for Description and Change Comments.

    SharePoint ribbon Change Comment
     
  3. Click on the "Submit" button.

    SharePoint Publishing workflow
     
  4. The UDA is published successfully.

    SharePoint workflow published successfully
     
  5. The UDA is created successfully and it is defined at the team site level.

    workflow team site level
     
  6. If you want to use it at the site collection level then click on the "Promote" button in the ribbon interface.
  7. Click on "Ok".

    workflow webpage message
     
  8. Now the UDA can be used at the site collection level.

    workflow site collection level

Create NINTEX list workflow

Use the following procedure to create a NINTEX list workflow:

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

    SharePoint Nintex Workflow
     
  4. Click on "Cancel".

    SharePoint Nintex Workflow create
     
  5. Drag and drop the FullName UDA action from "User Defined Actions" section.

    SharePoint workflow User Defined Actions
     
  6. Click on "Configure" from the drop down list.
  7. Click on the "Variables" button.

    SharePoint workflow Variables button
     
  8. Click on "New".

    ccreate new workflow Variables
     
  9. Enter the following details.

    Fill workflow Variables details
     
  10. Click on "Save".
  11. The Variable is created successfully.

    workflow Variables created
     
  12. Click on the "Insert Reference" button for the First Name column and then click on the "Item Properties" tab. Select "First Name" and then click on "Ok".
  13. Click on the "Insert Reference" button for the Last Name column and then click on the "Item Properties" tab. Select "Last Name" and then click on "Ok".

    Insert Reference in workflow Variables
     
  14. Select the fullName variable to store the output.
  15. Click on "Save".
  16. Drag and drop the "Update Item" action from the workflow actions.

    workflow actions
     
  17. Click on "Configure" from the drop down list.
  18. Set the value as shown below.

    Set the value for workflow
     
  19. Click on "Save".

Publish the workflow

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

    publish the workflow
     
  2. Make sure the Title is set; optionally you can set the values for Description and Change Comments.

    Change Comments for workflow
     
  3. Click on the "Submit" button.

    publishing the workflow
     
  4. The workflow is published successfully.

    workflow published

Test the workflow

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

    Workflows in the ribbon interface
     
  3. Click on GetFullName workflow and then click on the "Start" button.

    workflow Start button

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

    workflow status changed to Completed
     
  5. Full Name will be updated.

Summary

Thus in this article you saw how to create a User Defined Action for a NINTEX workflow in SharePoint.

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