IntroNintex has a neat little thing in SharePoint 2013 called a User Defined Action (UDA). It takes in inputs, does some stuff, and then spits out outputs. It's a handy way to create an action that you can reuse within your workflows.
In this guide, I walk you through how to create a UDA for grabbing e-mail addresses from a SharePoint group. Let's get started.
You will start by creating a new User Defined Action.
- On your site collection administration page, under the "Nintex Workflow" Heading, select Managed User Defined Actions
Then create one input parameter and one output parameter. From the ribbon, select "Parameters" from the "UDA Settings" button on the "Manager User Defined Actions" tab on the ribbon. It looks like this:
Add the following parameters:
- Input: GroupName, Text
- Output: UserEmailCollection, Output
Then add two Actions:
- Call Web Service
- Query XML
Configure "Call Web Service" action as follows:
- URL is the location of the UserGroup.asmx web service. I use web URL here, but you can use a site collection URL as well.
- Workflow Credentials for the web service. In this case, I use a variable that stores the credentials.
- Hit refresh and the drop down will populate with a list of methods. Choose "GetUserCollectionFromGroup"
- You can choose either Editor mode, but, in this case, "SOAP builder" makes it easier
- "groupName (string)" is the input parameter to the Web Service. In this case, we are going to pass the UDA parameter "GroupName" (we created this in a previous step) to the web service parameter.
- Select "Specify elements"
- When you select "Specify elements" you will be presented with a dialog. Make sure expand the nodes until you get to GetUserCollectionFromGroupResult. Then select it.
- Output your result to a workflow variable. In this case, I created one called, "UserXML"
Configure the "Query XML" action as follows
- Select your "XML" as your "XML source"
- Select "Insert Reference" and then put in your Workflow Variable that was output from the previous step. In this case, "UsersXML"
- Process using "XPath"
- Add the following XPath (without the quotes): "/defaultNS:GetUserCollectionFromGroup/defaultNS:Users/defaultNS:User/@Email"
- Return results as "Text"
- Store the result in the output parameter that you created earlier. In this case, "UserEmailCollection"
Don't forget to publish it!