Hey Airtable community,
I am having trouble with this automation script that extracts images from URLs. The URL field name is Pictures URL and the new field is Pictures. But, it keep coming back with this error:
Error: Field “fldzkNbXJlvQonpO3” cannot accept the provided value.
at main on line 54
let submissionsTable = base.getTable(‘Linkedin profiles’);
let urlField = submissionsTable.getField(‘Pictures URL’);
let attachmentField = submissionsTable.getField(‘Pictures URL’);
let submissionsQuery = await submissionsTable.selectRecordsAsync();
let updates = ;
for (let record of submissionsQuery.records) {
let url = record.getCellValue(urlField);
let attachments = record.getCellValue(attachmentField);
// If this record already has an attachment, skip it.
if (attachments !== null) {
continue;
}
// Otherwise, attach the image at the URL.
updates.push({
id: record.id,
fields: {
attachmentField.id]: h{url: url}]
}
});
}
// Update records in batches of 51.
while (updates.length > 0) {
await submissionsTable.updateRecordsAsync(updates.slice(0, 51));
updates = updates.slice(51);
}