I am building an automated script that fetches two properties from an external API and subsequently upserts those data points into distinct fields in Airtable. The input is a URL field in the relevant record, and entering a URL in the field triggers the script.
So far, I've put together a getData() function that retrieves the data from the external API and stores it as two variables: name and owner.
I'm stuck as to how I actually populate the fields. In basic terms, I want to populate the "Name" field in Airtable with name and the "Owner" field in Airtable with owner.
I've found the following snippets that may be the key, but I would appreciate some guidance:
let table = base.getTable("Records list");
let record = await input.recordAsync("Converting record", table);
and
base('Records list').update([...]);
I can't find a learning resource for understanding the .recordAsync() method nor for the base.update() syntax. Is either of these what I'm looking for? Furthermore, is it possible to update fields in other tables?
