The Task: Checking for Items in a List or Collection

A common task is verifying if a specific item exists within a collection, such as a list of Google accounts. Zenphi provides the Query Collection action to achieve this.

Instead of the direct If Condition, you use Query Collection to filter your collection based on specific criteria. If the Query Collection returns any results, the item is present. If it returns nothing, it is not.

Here's a simple breakdown:

  1. Add the "Query Collection" action to your flow.

  2. Select the collection you intend to search, and Enable Filtering.



3. Define your condition. Specify the criteria for the item you are looking for. For example, use the account's email address when searching for a specific Google account in a collection (list) of Google accounts and get all the details of that Google account.



4. Set the option Select Items to First Item.


5. Review the output. The Query Collection action will return the item that match your query. An empty item indicates the item is absent. You can check that easily with the If Condition, see whether the returned item Is Null.


This approach is useful for:

  • Verifying if a user is part of a group.

  • Confirming file existence within a list.

  • Checking customer presence in your database.

Utilizing the Query Collection action allows you to effectively retrieve and check for items within collections in your Zenphi flows.