Skip to main content

Filter, sort, and clear collected records

Narrow down, order, and empty a collected list before the next step, for example keep only high-priority tasks and sort them by due date first.

Written by Leo

Filter collected, Sort collected, and Clear collected are three actions that work on a list of collected records. Filter collected keeps only the records that match a condition, Sort collected puts them in a new order, and Clear collected empties the list. They're meant to help you shape a collection after an earlier action collected it.

You can use these actions for many things, including:

  • Keeping only tasks with the priority "High" before you send each assignee an email.

  • Sorting open invoices by due date, so the oldest ones come first.

Adding Filter collected below Search for records in an Expenses automation, then Add filter with the condition Amount > 5000

Note:

  • Collect first. All three actions work on a collection created by an earlier action, such as Search for records, Get view, or Get related. Without a collection, Select collected records shows No results.

  • Each collecting action returns up to 1,000 records. If more records match, the result is cut to the first 1,000 without a warning. If you collect from the same database app twice, the second action adds to the same list.

  • Order matters. Actions run from top to bottom. Add Filter collected or Sort collected above the action that uses the list.

Who can use the collection actions?

  • Automations are available on the Free, Plus, and Premium plans. The number of automation actions per month depends on your plan. See the limits for your plan on our pricing page.

  • To add or change these actions, you need to be a workspace admin of the workspace the database app is in. You also need full access to every database the automation uses.

Filter collected

The action Filter collected records in Expenses below Search for records, with Add filter and Add filter group

Filter collected removes records from a collection that don't match your conditions. In the action list, its description reads Filter collected records.

To filter a collection:

  1. Open the database app and click the automations icon at the top right (Create and view automations).

  2. Open an automation, and add an action that collects records, for example Add action → Search for records.

  3. Select Add action → Filter collected. The step appears as Filter collected records.

  4. Check the collection. Tape preselects the nearest collection above this action. To change it, select its name. Without a collection, it reads Select collected records.

  5. Select Add filter. Tape adds a row Where with the first field and an operator that fits the field type, for example Contains for text or = for numbers. Select the field name to choose the field to check, change the operator if needed, then enter the value. The placeholder in the text box is Value.

  6. Add more conditions with Add filter, or nest conditions with Add filter group. Combine conditions with And (all filters must match) or Or (at least one filter must match).

  7. Select Save changes. For a new automation, the button reads Create automation.

Filter collected settings:

  • Select collected records: the collection to filter.

  • Where: the first condition. Each condition has a field, an operator, and a value.

  • Add filter: adds a condition.

  • Add filter group: adds a group of conditions. Combine conditions with And (all filters must match) or Or (at least one filter must match).

The operators depend on the field type, like in other filters. If you add no condition, all records stay in the collection. Learn more about filters →

Sort collected

The action Sort collected records in Expenses below Search for records, with one sort by Expense, Ascending, and Add sort

Sort collected puts the records of a collection in order. In the action list, its description reads Sort collected records. Sort a collection when the order matters later, for example in an email table, or when later actions use the values of the first record in the list.

To sort a collection:

  1. Select Add action → Sort collected. The step appears as Sort collected records.

  2. Check the collection. Tape preselects the nearest collection above this action. To change it, select its name. Without a collection, it reads Select collected records.

  3. Check the first sort row. Tape preselects the first field with Ascending. Select the field name to choose another field, and switch to Descending if needed.

  4. Select Add sort if you need a second sort field.

  5. Select Save changes.

Sort collected settings:

  • Select collected records: the collection to sort.

  • Add sort: adds a sort field. Each sort has a field and a direction.

Tape applies the sorts from top to bottom, so a later sort field breaks ties of the earlier ones. For example, sort by priority first, then by due date.

Clear collected

The action Clear collected records in Expenses below Search for records

Clear collected empties a collection. In the action list, its description reads Clear collected records. Clear a collection when you want to start over, for example before you collect from the same database app a second time.

To clear a collection:

  1. Select Add action → Clear collected. The step appears as Clear collected records.

  2. Check the collection. Tape preselects the nearest collection above this action. To change it, select its name. Without a collection, it reads Select collected records.

  3. Select Save changes.

Clear collected has one setting, Select collected records. It clears only the list in the automation. The records themselves aren't changed or deleted. Save values you need later first, for example with Rollup collected. After Clear collected, the list is empty, but you can still select it in later actions, for example to collect into it again.

Let's look at an example

Let's say your project team wants to warn the assignees of high-priority tasks, oldest due date first. Here's how:

  1. Set the trigger to When a record is updated in the database app Sprints and select the field Status.

  2. Add the filter Where Status Has changed to "Closed".

  3. Select Add action → Search for records, select the database Tasks, and collect all tasks.

  4. Select Add action → Filter collected, then select Add filter and set the row to Priority Is "High".

  5. Select Add action → Sort collected, then set the sort row to Due date, Ascending.

  6. Add the action that uses the list, for example Comment on collected.

  7. Select Add action → Clear collected and select the collection.

  8. Select Save changes.

The comment goes only to the high-priority tasks, and the list is empty again afterward.

Collection action errors

  • If a step fails, the run shows the step and its message in the automation's runs. Open the automation and select ▷ next to Manual run (View all runs, cmd/ctrl + 1). Each run shows its status, for example Success; select a run to see every step. For all automations, open Runs in the Automation Center and filter by App, Automation, or Status.

  • If Select collected records shows No results, add a collecting action above this one.

  • If the filter matches no record, the collection is empty and the actions after it have nothing to work on. If the list is empty, the actions that use it do nothing, and the run continues.

Test, pause, or edit the collection actions

  • Manual run runs the automation once. It appears after the automation is saved. Under Run on, select the records, then select Start run (Save and start run if you have unsaved changes). Actions that follow, such as updates or emails, work on real records.

  • New automations you create in the editor are Active right away. The status, Active or Paused, sits below the automation's name in the editor. To pause one, select the status to switch it to Paused, then select Save changes.

  • To change an action, open the automation, select the step, make your changes, then select Save changes.

  • Each action has a menu with Settings, Continue on error, Deactivate, Turn into, Duplicate, and Remove. Learn more about action settings →

Learn more

FAQs

Why filter a collection instead of filtering in Search for records?

Filter in Search for records when you only need the matching records. Use Filter collected when you want to keep the full collection for one step, then narrow it down for another.

Does Filter collected change my records?

No. It only changes the list in the automation. Your records stay as they are.

Do I need Clear collected?

Not always. Use it when you want to collect again and start from an empty list.

Can I sort by more than one field?

Yes! Select Add sort again. Tape sorts by the first field, then uses the next field to order records that have the same value.

Is there a limit for the size of a collection?

Yes. Each collecting action returns up to 1,000 records. If several actions collect from the same database app, their records add up in one collection. Learn more about limits →

Are there other actions I can use?

Yes! Actions can create and update records, add comments, send emails, create PDFs, call other services, and more. See every action in Automation actions →

Are you a developer using the Tape API for automations?

The automation API has its own documentation for developers. Full reference: filter_record_collection →

Still have questions? Find answers and get help from community experts in the Tape community →

Did this answer your question?