Hi all, I’m new to scripting in Airtable and I got a bit confused about my error.
I’m using two variables for the script
- projectID which is the ID of the project that is linked to the test record
- linkedIndicatorIDs which are the IDs of all the indicators that are linked to the test record
When I run this script it gives an error “Error: Field XXX cannot accept the provided value.” for the project field although via the console.log I see that the correct projectID is being used. I don’t really understand why it doesn’t work for linking the project if it does work for the indicator (I tested succesfully the script without the project linking).
let inputConfig = input.config();
let table = base.getTable('Progress General Indicator 🚫');
let indicators = inputConfig.linkedIndicatorIDs;
let projectID = inputConfig.projectID;
for (let indicator of indicators) {
console.log(`Adding indicator ${indicator} to the new record.`);
console.log(`Adding project ${projectID} to the new record.`);
await table.createRecordsAsync([
{
fields: {
'Projects 🖌': [{id: projectID}],
'General indicators 🖌': [{id: indicator}],
},
}
])
}
Thanks in advance for your help!


