Loading
Salesforce now sends email only from verified domains. Read More
Automate Your Business Processes
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          Collection Filter Element

          Collection Filter Element

          Apply criteria to a collection, and then output a new collection that contains only the items that meet the criteria.

          Required Editions

          Field Description
          Collection The collection variable that is filtered. This field accepts any collection variable within the same flow.
          Condition Requirements

          Determines the logic that evaluates conditions.

          • Choose All Conditions Are Met to include values that meet all the specified criteria.
          • Choose Any Condition Is Met to include values that meet any of the specified criteria.
          • Choose Custom Condition Logic Is Met to include values that meet the logic entered in Condition Logic.
          • Choose Formula Evaluates to True to include values where Formula is true for that value.
          Condition Logic Only appears if Condition Requirements is set to Custom Condition Logic Is Met. Enter logic such as 1 AND (2 OR 3).
          Formula Only appears if Condition Requirements is set to Formula Evaluates to True. Enter a formula that can evaluate to TRUE or FALSE, such as {!currentItemFromSourceCollection.Id} == {!varContactID}.
          Field The field evaluated by this condition. Doesn’t appear if Condition Requirements is set to Formula Evaluates to True.
          Operator The available operators depend on the data type of the selected Field.
          Value

          Field and Value in the same row must have compatible data types.

          Options:

          Usage

          You can filter any collection found in Flow Builder, including collection variables that contain single values, collection variables that contain records, and Apex-defined collection variables.

          Collection Filter outputs a collection with the filtered results and doesn’t change the contents of the source collection. The output collection is null until its corresponding Collection Filter runs.

          Note
          Note The output collection variable is named after the Collection Filter element's API name.
          Example
          Example
          • For example, if a Collection Filter element is named FilterLeads, its output collection is called Leads from FilterLeads.
          • The Collection Filter element also creates a single variable called CurrentItem_FilterLeads. It acts as a loop variable for the Collection Filter element's input collection.
          • You can reference the single variable in a formula resource. For example, you can create a Filter element formula condition where you set condition requirements to Formula Evaluate to True: AND ({currentItem_FilterLeads.LastViewedDate} < {!$Flow.CurrentDateTime,{!currentItem_FilterLeads.IsConverted})

          If you filter your collection with a formula, the formula must evaluate to a boolean (true or false) value. For more formula considerations, see Flow Formula Considerations in Salesforce Help.

          If you delete a Collection Filter element, the CurrentItem_FilterLeads variable remains in the flow. You can safely delete this single record variable after you remove the collection filter element.

          Considerations for Defining Filter Criteria

          • When you define multiple filter criteria, the filter logic usually defaults to AND. But if multiple filters have the same field selected and use the equals operator, the filters are combined with OR.

            For example, your filters check whether a case Type equals Problem, Type equals Feature Request, and Escalated equals true. At run time, the filters are combined to be Type = (Problem OR Feature Request) AND Escalated = true.

          • The available filter operators depend on the data type of the selected fields. For details, see Flow Operators in Data Elements and Record Choice Sets.
           
          Loading
          Salesforce Help | Article