Search for records is an action that collects the records of a database app that match your filters (the trigger decides when the automation runs, and the action decides what happens). It's meant to help you look things up, like existing customers or duplicates, without leaving the automation.
You can use this action for many things, including:
Checking whether a new lead already exists before you create a task for it.
Collecting every open invoice of a customer to send one reminder.
Note:
The action only collects records. It doesn't change anything. Use the collected records in later actions, like
Update collected,Comment on collected,Send email to collected, orLoop actions.A search collects up to 1,000 records. If more match, the result is cut at 1,000, and no error appears. Learn more about limits →
Who can use the Search for records action?
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 this action, 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.
Add the Search for records action
To search for records from an automation:
Open the database app and click the automations icon at the top right (
Create and view automations).Open an automation, or select
New automationand choose a trigger.Select
Add action→Search for records.Open the app dropdown after
inand select the database you want to search.Select
Add filterto narrow the results.Add actions below that use the collected records.
Select
Create automationfor a new automation, orSave changesfor an existing one.
Search for records settings
App: the database app that is searched. It can be any database app, not only the database of the automation. The dropdown lists the database apps of every workspace where you're a workspace admin and have full access to the app.
Filter: each row has
Where, a field, an operator, and aValue. For example,WhereExpenseContainsa word. SelectAdd filterfor more rows. Without a filter, the search collects all records of the database, up to the limit. All filters must match. To find records that match one of several conditions, use several searches orFilter collected.Limit results: in the•••menu of the action. It sets the maximum number of records to collect. WithoutLimit results, the action collects every matching record, up to 1,000. When you switch onLimit results, the action readsand limit results to, followed by the number. It starts at 1.Continue on error: keeps the run going if the search fails.
Filters follow the same rules as in other places of an automation. The operators depend on the type of field. Learn more about filters →
You can use record values in the Value box, for example the Email of the record that started the automation, to find records with the same email.
You can filter on most field types, including text, number, category, status, people, relation, date, email, phone, link, location, file, image, and calculation fields, and on who created or last changed a record and when.
To leave out the record that started the automation, add a filter Where App Record ID ≠ and type @ to insert the current record's App Record ID.
Use the collected records
The records you find are called collected records. They stay available for the rest of the run, and these actions work with them:
Loop actionsruns actions for each collected record.Update collected,Comment on collected, andSend email to collecteddo the same thing for all of them.Filter collected,Sort collected, andClear collectedrefine or empty the list.Get related for collectedfollows relation fields to more records.
Let's look at an example
Let's say your sales team wants to avoid duplicate leads. Here's how:
Set the trigger to
When a record is createdin theLeadsdatabase app.Select
Add action→Search for recordsand choose theLeadsdatabase.Select
Add filter:WhereEmailContainstheEmailof the new lead. For email fields, useContains; text fields also offerIs.Select
Add action→Conditional actionsand run the next actions only if more than one record was found (the search finds the new lead too). To get the number, addRollup collectedwithCount allafter the search, then check the result inConditional actions, for example> 1.Inside the condition, add
Add commentwith "Possible duplicate".Select
Create automation.
The next time a lead is created with an email that already exists, the record gets a comment like "Possible duplicate".
Search for records errors
If the search finds nothing, check the filter and the database app you chose. A filter row without a value makes the search return no records.
If the search finds fewer records than you expect, the limit may be applied. Check
Limit results.If the step fails, the run shows the step and its message. Open the automation and click
▷(View all runs) at the top, or usecmd/ctrl+1. Each run shows its status, for exampleSuccess; select a run to see every step. For all automations, openRunsin the Automation Center and filter byApp,Automation, orStatus.If you search the same database twice, the second search adds its records to the same list. Use
Clear collectedbefore it if you only want the new results.
Test, pause, or edit the Search for records action
Manual runruns the automation once. UnderRun on, select the records, then selectStart run, orSave and start runif you have unsaved changes. The search is only a read, but later actions can change real records.To stop only this action, select
•••→Deactivate.To change the search, open the automation, select the step, make your changes, then select
Save changes.
Learn more
FAQs
Can I search in a different database app than the trigger's?
Can I search in a different database app than the trigger's?
Yes! Open the app dropdown after in and select another database app. The dropdown lists the database apps of every workspace where you're a workspace admin and have full access to the app.
How many records can a search find?
How many records can a search find?
Up to 1,000. If more records match, the result is cut at 1,000 and you don't see an error. Narrow the filter, or work in batches.
Can I search for a word anywhere in a record?
Can I search for a word anywhere in a record?
No. It searches only in the fields you choose in the filters.
Can I find duplicates with this action?
Can I find duplicates with this action?
Yes! Search for records with the same value, then add a comment, a task, or an email instead of deleting. Learn more about finding duplicates →
Can I choose the order of the results?
Can I choose the order of the results?
Yes, with Sort collected after the search. Learn more about sorting collected records →
Are there other actions I can use?
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?
Are you a developer using the Tape API for automations?
The automation API has its own documentation for developers. Full reference: collect_app_records in the developer docs →
Still have questions? Find answers and get help from community experts in the Tape community →
