All plan types with varying limitations | |
| |
Platform(s) | Web/Browser, Mac app, and Windows app |
Related reading | Creating an automation - Learn how to set up your first automation in Airtable. |
In automations where you have already used a “Find records” automation action, you can add an additional automation action to then sort the records that are found. This way, in later automation action steps, the list of records can be processed in an expected format. Read on to learn more about how to set up this type of automation action and the expected behavior and known limitations.
Note
Automations must contain at least one “Find records” action in order to add and configure a “Sort list” action.
Setting up an automation to sort a list of records
To set up an automation to sort a list of records:
Open your Airtable home screen.
Open the base where you want to create an automation.
Click Automations.
Click + Create new.
Click + Create automation.
Click + Add trigger.
Once clicked, the available triggers will display for you to choose from.
Click the + Add advanced logic or action option.
Scroll down in the menu that appears, then find and click on the “Find records” option
Configure this action to fit your needs. If you need more information about setting up the “Find records” action, consult the following documentation.
Click the + Add advanced logic or action or the + button that appears in between the existing “Find records” action and another action in your automation’s configuration.
Click Sort list.
Under “Configuration,” click the blue Select input list button.
Select the “Find records” action step that you would like to sort, then click the Use as a list token option.
Some automations may contain multiple “Find records” steps, so be sure to read the short description provided so that you select the correct action. You’ll need to set up multiple “Sort list” actions if you want to sort the outputs of multiple “Find records” actions.
Next, under “Sort by” configure the conditions to sort based on one or more field conditions. This will modify the list output to be sorted according to your specific sort conditions.
Now, you can click Test action and then scroll down to the "Sorted items” section to get a preview of what the sorted output of found records would look like. Click into the Field values if needed, to glean details about each record in the list. If needed, go back and adjust any of the configuration parameters discussed above.
After you've found and sorted the records you are looking for, you can add another action to determine what step to take with those records (as long as at least one record was found).
Limitations and dependencies
Unsupported field types
Lookup fields
Multi-select fields
Foreign key fields (i.e. fields linking to other records)
Attachment fields
Button fields
Multi-user fields. Single user fields can be used as a sort field. In this case, the user's name will be used to sort.
Miscellaneous limitations and dependencies
The “Sort list” action only accepts record arrays returned by the "find records" action as an input from a previous step in the automation you are configuring. Record arrays returned from the "Custom script" action are not valid inputs to use with a “Sort list” action.
Sorting a record list array before using it as an input to a repeating group of automation actions does NOT affect the processing order. We do not offer any guarantees with regards to the order in which a repeating group of actions are processed.
Any records that don't have a value for a chosen sort field will show up last in the sorted list, regardless of whether the selected order is ascending or descending. In other words, if the sort field is "Name,” then records with an empty "Name" field will always show up last in the list of records.