I’ve been trying to modify a script I’ve found on the airtable community that would allow me to click a button and trigger a script to move a record to another table. But it seems that in the process, it moves every record in the table. Is there a way to make it only move ONE record?
let table1 = base.getTable(“New Leads”);
let table2 = base.getTable(“Following-Up With”);
let result = await table1.selectRecordsAsync();
for (let record of result.records) {
if (record.getCellValue(“Move To Following-Up”)) {
await table2.createRecordsAsync(a
{
fields: {
‘Name’: record.getCellValue(“Name”),
‘Email’:record.getCellValue(“Email”),
‘Phone’:record.getCellValue(‘Phone’),
},
}
]);
await table1.deleteRecordAsync(record.id);
}
}
This is the script I have currently, any help is appreciated