Help

Airtable Automations: Perform an action for each record found from Find Records

2792 3
cancel
Showing results for 
Search instead for 
Did you mean: 
mimen1994
4 - Data Explorer
4 - Data Explorer

Is there a way to loop through each record found from the Find Records action, and perform a subsequent action for each individual record? As far as I can tell, you can only do something with the list of record IDs that result. I can think of workarounds but they are extremely complicated and I figured I'd ask to see if there's something a little more proprietary. 

3 Replies 3

Hey @mimen1994

As of right now, there isn't a way to iterate through a collection of records using the built-in automation actions.
With that being said, depending on how many records you're working with and the complexity of what you're trying to do, you can pretty easily script the actions you're trying to take on the records.

For example, if you wanted to create new records for each record, you can get away with a quick script like this:

const config = input.config();
const { records } = config;

const tableId = "yourTableId";
const table = base.getTable(tableId);

for (let i = 0; i < records.length; i++) {
    await table.createRecordAsync({
        "field1": "value",
        "field2": "value",
        "field3": [{id: "value"}],
        "field4": {name: "value"},
        "field5": new Date()
    });
};

For the record, if you are actually considering scripting, I should mention that you want to use the createRecordsAsync/updateRecordsAsync methods in order to conduct bulk record operations. Take the code snippet above as just an example

Now, there's another alternative that can be found in an automation tool like Zapier or Make. This is probably your best option if you have no desire to get a bit hands on in the scripting solution.
Assuming you're not already an existing user, I recommend Make over Zapier.

Hi,

worikaround exist - you should create linked field, select "new table" and new tables with a single record will be created. You then put array of IDs received from 'Find records' to that single record link field and create second automation reacting on change in link field of your first table.

perrytancredi
5 - Automation Enthusiast
5 - Automation Enthusiast

For anyone finding this, Airtable now supports this with their Repeating Groups function: https://support.airtable.com/v1/docs/repeating-groups-of-automation-actions