Loading
Prepare for Email to Become the Default Login ExperienceRead More
Automate Your Business Processes with Salesforce Flow
Collection Sort Element

Collection Sort Element

Reorder the items within a collection and optionally limit the number of items that remain in the collection after the sort.

Required Editions

Field Description
Collection Variable The collection variable that is sorted. This field accepts any collection variable within the same flow.
Sort By The field that the collection is sorted by. This field is only shown if the collection variable contains more than one field.
Sort Order Sort the collection in ascending or descending order.
Put empty string and null values first When selected, this element sorts records with an empty or null value in the Sort By field at the start of the collection. Otherwise, they’re placed at the end.
How Many Items to Keep After Sorting Select Set the maximum number of items to determine the number of items that remain in the collection after the sort.

Usage

When the Collection Sort element removes values or changes their order, it makes those changes directly in the selected collection variable.

If the collection variable contains more than one field, click Add Sort Option to sort by additional fields in order of greater to lesser priority. You can sort by up to 3 fields at a time.

 
Loading
Salesforce Help | Article