Query List

<< Click to Display Table of Contents >>

Navigation:  NITRO™ Workflows > Configuring Workflows > Workflow Actions >

Query List

Query List

This action will retrieve an item or item collection based on a lookup column or query. The output of this action can then be used in other actions (like Create Item or Update Item). For example, you may want to cancel all Tasks related to a request when that request is cancelled. Or for each of these tasks meeting some criteria, you may want to create an item in another task list.

The Query List action would precede another action, if that Query List is to be used in that other action. "Query List" itself just generates a list of items based on a CAML query so that this list can be used in the other actions: Create Item, Update Item, Delete Item, and Manage Permissions.

This action is also used to check if items with certain criteria are present or not. For example, you can check if all related tasks of a request are closed and if so then change the status of the request.

WF Query List 1

 

A Query List can be generated as a single Item (Type = Item) or a collection of Items (Type = Item Collection).

The Query Site and Query List are where the item(s) will be fetched from.

The item(s) in the Query List can be fetched by using either a Lookup Column on that List or a CAML Query (see below). Once the Query List is generated, it is held in memory for use by other actions.

"Continue Workflow Execution" allows you to determine if the NITRO Workflow should continue, based on what is generated in the Query List action. That can be to Always continue running the actions in the NITRO Workflow, or to continue only if one or more items are in the Query List or, alternatively, if only if no items are in the Query List. The reasoning behind this is that if you are running an Update Item Action using a Query List, and the Query List is empty, there is no need to continue with the Update (nothing to update).

Alternatively, you may want to run an Update Item action that closes a Ticket only when no sub-tasks are found (the Query List is empty).

There are other such situations, and the Continue Workflow Execution gives you options on controlling the processing of the NITRO Workflow based on the results of the Query List action.

 

WF Query List3

 

Information on CAML Queries

 Introduction to CAML

 CAML Query Syntax

 

Examples:

Query Syntax:

<Where>

<Eq>

 <FieldRef Name='LookupFieldInternalName' LookupId='TRUE' />

 <Value Type='Lookup'>##ParentFieldLookupName##</Value>

 </Eq>

 </Where>

Example:

<Where>

<Eq>

 <FieldRef Name='RelatedTicket' LookupId='TRUE' />

 <Value Type='Lookup'>##ID##</Value>

 </Eq>

 </Where>