The back end of one of our products is built on Airtable. Its been runing fine, but in the last couple of months (since May 18th) it hasn't been working anymore. Unfortunately we didn't discover this until now, and this means a key product in our whole business is broken/down.
Did airtable change its scripting system to change how attachment fields work? The images being attached work, the script appears to successfully run, logs are totally okay, just the images don't get attached at the end.
More info:
We wrote an airtable script that, based on data, attaches a photo to the airtable. The script stopped working recently. It gets triggered, appears to run, logs look fine, but images aren't attached. It was working before, but stopped working around may. What do you think the issue is?
We’ve emailed Airtable support but haven’t heard back yet :(
let table = base.getTable('Raw Data');
let inputConfig = input.config();
let recordNumber = inputConfig.RecordNumberAutomation; // Replace with actual record ID
let record = await table.selectRecordAsync(recordNumber);
console.log(Processing record number: ${recordNumber});
// Define the categories and their corresponding Flickr image URLs for deep dive
const categories = {
'Significance': 'https://i.imgur.com/Es0j84s.png',
'Love/Connection': 'https://i.imgur.com/l0aZNgs.png',
'Growth': 'https://i.imgur.com/JaaMjol.png',
'Contribution': 'https://i.imgur.com/KRXxFM2.png',
'Certainty': 'https://i.imgur.com/998a2OV.png',
'Variety': 'https://i.imgur.com/HkvZ3SS.png'
};
// Get the values of the "Primary" and "Secondary" fields
let primaryValueArray = record.getCellValue('Primary') || [];
let secondaryValuesObj = record.getCellValue('Secondary') || [];
console.log(Primary value array: ${JSON.stringify(primaryValueArray)});
console.log(Secondary values object: ${JSON.stringify(secondaryValuesObj)});
async function processImages() {
let updateObject = {};
try {
// Process Primary_deepdive
if (Array.isArray(primaryValueArray) && primaryValueArray.length > 0 && primaryValueArray[0].name) {
let primaryValueName = primaryValueArray[0].name;
console.log(Primary value name: ${primaryValueName});
if (categories[primaryValueName]) {
let primaryImageUrl = categories[primaryValueName];
console.log(Processing primary image for: ${primaryValueName});
let primaryAttachment = [{
url: primaryImageUrl,
filename: ${primaryValueName}_deepdive.jpg
}];
updateObject['primary_deepdive'] = primaryAttachment;
console.log(Primary image attachment created for: ${primaryValueName});
}
}
// Process Secondary deepdives
if (secondaryValuesObj.length > 0) {
if (secondaryValuesObj[0] && categories[secondaryValuesObj[0].name]) {
let secondary1ImageUrl = categories[secondaryValuesObj[0].name];
let secondary1Attachment = [{
url: secondary1ImageUrl,
filename: ${secondaryValuesObj[0].name}_deepdive.jpg
}];
updateObject['secondary 1 deepdive'] = secondary1Attachment;
console.log(Secondary 1 image attachment created for: ${secondaryValuesObj[0].name});
}
if (secondaryValuesObj[1] && categories[secondaryValuesObj[1].name]) {
let secondary2ImageUrl = categories[secondaryValuesObj[1].name];
let secondary2Attachment = [{
url: secondary2ImageUrl,
filename: ${secondaryValuesObj[1].name}_deepdive.jpg
}];
updateObject['secondary 2 deepdive'] = secondary2Attachment;
console.log(Secondary 2 image attachment created for: ${secondaryValuesObj[1].name});
}
}
console.log(Preparing to update record with: ${JSON.stringify(updateObject)});
// Update the record with the new attachments (using the record ID)
await table.updateRecordAsync(record.id, updateObject);
console.log("Record updated successfully with new images");
} catch (error) {
console.error("An error occurred:", error.message);
throw new Error('Updating deep dives for report failed.'); // Example error message to stop the automation
}
}
// Run the main function
console.log("Starting image processing");
await processImages();
console.log("Image processing completed");
Question
Business critical automation stopped working URGENT ADVICE PLEASE
Login to the community
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
