What’s New: Office365 – Query Task IDs for Multiple Approvers

Querying your workflow tasks just became easier in Office 365!

We have added the ability to output task IDs directly to a variable on our Start a Task Process and Assign a Task actions for Nintex Workflow for Office 365. This includes support for multiple tasks.

The ability to output the Task ID of any task associated with a workflow has been available in Nintex for SharePoint and is now available in Nintex for Office 365. It allows users to easily query and work with information users submit via task forms.

This can include information such as:

• Comments
• Who replied with what response?
• Task due date vs. date of reporting
• Status of task responses after or before task completion
• Audit trails for detecting non-compliance

nintex

When configuring the action, you can output a collection of the task IDs generated by the Start a Task Process action. With this you can collate and store all comments, responses and feedback. Ultimately this means you can easily audit who did what within the task process.

Let’s take a look at the most common use case, which Jon Hardy wrote about in this Nintex Tech Blog post How to get Task Comments and more in Nintex Workflow for 365.

In the post, Jon outlines the use case for pulling information from any of your associated workflow tasks. He walks through the difficulties of handling multiple tasks and multiple variables when the Task ID is not immediately available. This is important because many users wish to capture the comments of multiple respondents, including who responded and when.

As Jon writes:

” ‘Start a Task Process’ assigns tasks to multiple respondents and tracks their responses to their tasks. When sufficient respondents have replied to give an outcome (as specified in the task settings), then it will proceed down the respective outcome branch.”

“Previously, you had to go through several steps to identify all associated tasks and ensure they had unique names in order to query them. Now, you can utilize the “Task IDs” functionality to store all Task IDs associated with an individual task. This will save significant amounts of development time within the workflow and allow you to utilize information submitted to the task list immediately, making it available for presenting to users, capturing for records, and management or audit review.”

nintex

You can take the collection of IDs that was output by the task and use Query List and For Each to check against each associated task in the collection.

Querying the Task List

The task list is a list in Nintex for Office 365 that can be queried using the Query List action. In this example, we have the set of Task IDs to easily identify the correct tasks.

The first step I want to illustrate is to loop through the collection of IDs with a For Each and output the task IDs to my ID Variable.

nintex

In the query, we can return any of the columns in the task list of interest, such as Assigned to, Modified by, Comments, Completed, Due date, Outcome, etc.

The Query criterion is then: ID is equal to {Variable:ID}

You can output the results directly to text variables, or bundle the results together in further collections for processing later within the workflow.

nintex

Tips & Resources:

Note 1: To maintain query performance you may wish to create a dedicated task list for this workflow.

Note 2:  Although you can query for the Task ID using this method, it may not be reliable to write to the task list, for example, to update a task. The workflow engine may lock the record, causing writing to the list to fail and possibly causing the workflow to terminate. This is because the SharePoint task engine is orchestrating task list updates and will lock the list item at any time. Attempts to write to the task list may work at times and fail at others, depending on the timing of completing task list updates from the SharePoint task engine.

 

Visit the Nintex Community today to learn more and engage in conversations with fellow Nintex users! 

Thomas Clark

Thomas Clark is a Nintex Technical Evangelist based in our London office.