Find an item in a list by running a Child Flow on the items, one at a time, and returning the first item where the Flow returns True. (For simple searches, use the Find function instead.)

To use this function, you’ll need a Child Flow that performs the test on each item, one at a time. Define fields on the event card that will be the inputs that you’ll use to determine whether or not the item is a match. At a minimum, you’ll need a field for the item from the list (which you can name whatever you want). Then build the rest of the child Flow, ending with a Return card with a single field of type True/False.

Calling a child Flow allows you to do tests of any complexity (e.g. given a list of email addresses for a particular customer, you could look up to find the first one that already exists in your marketing database).

To return all of the items that match a test, use Filter or Filter Custom instead.

Input Fields

Fill out the Find card as follows:

  • list: The list you want to search
  • flow: The child Flow (as described above) that will be called once for each item in the list, until a match is found
  • with the following values (dynamically generated):
    • item: (will have whatever name you chose when you created your child Flow) Click in the field that will hold the current item from the list and choose “Item.” (Or, in some instances, you may also be able to select a specific path within an object if only that value is needed from each item.)
    • You can have optional additional fields on the child Flow event card in child Flow you chose, and those will also show up as input fields.

Output Fields

  • item: The first item in the list that results in the child Flow returning True. Make sure to set the type of _item_ to match the type of the list.
  • index: The location of the found item in the original list, where 0 is the first item in the list. Returns -1 if there is no match.

Example

If list is [2,4,12,7,3,8] and _flo_ is set to a child Flow that returns True if a number is an odd number, and Item is passed to the child Flow’s input, then the output _item_ is 7 (the first item in the list where the child Flow returns True) and index is 3.