Check if item exists in collection
The Check if item exists in collection action A tool for building the processes, logic, and direction within workflows. determines if an item value exists in the specified collection A variable containing multiple items, such as email addresses. Collection variables are useful for storing and operating on query results. For example, you can set up collection variables for names, email addresses, and index values to store results from querying a list. You can then loop through items in a particular collection variable (names, emails, or index values)..
For example, check query results for expired contract dates before running later actions in the workflow.
Before you begin:
-
Understand Variables
-
Understand the Start a loop and Loop for each actions
Jump to:
Add and configure the Check if item exists in collection action
In the Designer page:
-
Click the Collection operations action group in the action toolbox.
or
Find actions by browsing action groups, or by typing an action name or function in the Search field at the top of the action toolbox.
- Drag the Check if item exists in collection action to the point in the workflow when you want to check for the item.
- Click the Check if item exists in collection action.
-
Complete the fields. For more information on the fields, see Check if item exists in collection fields.
Example 1: ExistsField
Example configuration
Example returned contents
Target collection collProduce apple; carrot; romaine
Value
carrot
Store check result
boolExists Yes Store matching index
intIndex
1
Example 2: Does not existField
Example configuration
Example returned contents
Target collection collProduce apple; carrot; romaine
Value
orange
Store check result
boolExists No Store matching index
intIndex
-1*
* When a match index is not found, the integer variable is set to an invalid index value of '-1'.
Field |
Description |
Variable types |
---|---|---|
Target collection | Collection variable that you want to check. Accepts an inserted variable. |
Collection |
Value |
Item value that you are looking for. Accepts any combination of typed text and inserted variables. |
Boolean, DateTime, Decimal, File, Integer, Text |
Store check result |
Variable to store results of check. Accepts an inserted variable. Stores Yes if item exists, No if item does not exist. |
Boolean |
Store matching index |
Variable to store the matching collection index of check. Accepts an inserted variable.
|
Integer |