I have a script that calls an API and writes the JSON objects to my table. This has hit the limit of what I know about scripting.
Can anyone help modify my script so that on the next call, it will update any records that exist and insert any records that are new.
I assume I need an IF statement to look for an existing ID and validate if the associated string matches ELSE create a new record.
My existing script is:
let response = await remoteFetchAsync(“APIURL”, requestOptions);
let json = await response.json();
let table = base.getTable(“Titles”);
for (i=0; i < json.length; i++) {
let recordId = await table.createRecordAsync({
“Title”: jsonti].Title,
“ID”: json>i].ID
})
};
Thanks!