Description
In Salesforce Flow Builder, you can sort a collection using the "Sort" element. Here are the steps to sort a collection in Flow Builder:
Create or open an existing flow in Flow Builder.
Add a "Get Records" element to your flow and configure it to retrieve the records you want to sort. This will create a collection variable containing the records.
Add a "Sort" element to your flow and connect it to the "Get Records" element.
Configure the "Sort" element to sort the collection. You can specify the field to sort by, the order (ascending or descending), and whether to treat null values as high or low. You can also specify whether to sort in place or create a new sorted collection.
If you want to use the sorted collection in another part of your flow, you can create a new variable to hold it or use the existing collection variable.
That's it! Your collection will now be sorted according to the criteria you specified in the "Sort" element.