Hi everyone!
I’m happy to announce that we’ve released a new scripting API capability today, and this is available in both the Scripting App and the ‘Run a script’ Automation action.
You can now select records by recordId, either by setting a new recordIds option when calling selectRecordsAsync or by using the new convenience method selectRecordAsync when you only need one record.
This will be especially useful in Automations, where you can now easily select a Record based on a trigger or Find Records output.
Examples:
const recordIds = input.config().recordIds;
const table = base.getTable('Team');
const recordsResult = await table.selectRecordsAsync({fields: table.fields, recordIds});
const records = recordsResult.records;
for (const record of records) {
console.log(`Record name: ${record.name}`);
}
and
const recordId = input.config().recordId;
const table = base.getTable('Team');
const record = await table.selectRecordAsync(recordId);
if (record) {
console.log(`Record name: ${record.name}`);
}
We hope this new capability will help you with your scripts!
Thanks!

