As in the title, I’m trying to update multiple records with the results of a Find Records step.
I’ve got my ‘When a record is updated’ Trigger and ‘Find Records’ Action step set up correctly, but I’m having trouble with the script Action that comes afterwards.
I’ve adapted the code of another forum user (which updated a single-select field when records matched Find conditions):
let jobsTable = base.getTable("Jobs")
let packagelinkFieldName = "Package Link"
let inputConfig = input.config()
let recordsToUpdate = inputConfig.recordId
let thepackagelink = inputConfig.packageLink
let updates = new Array
for (let record of recordsToUpdate){
updates.push({
id: record,
fields:{
packagelinkFieldName]: {name: thepackagelink}
}
})
}
while (updates.length > 0) {
await jobsTable.updateRecordsAsync(updates.slice(0, 50));
updates = updates.slice(50);
}
The error I’m getting is:
Error: Field “fldZN1J0lfQqAQwXo” cannot accept the provided value.
at main on line 20
The Package Link field is a URL. I want the data in the ‘Package Link’ field to be inserted into the Package Link field for all records that match the Find Record action.
My input variables are:
recordId (which is the list of record IDs from the Find step)
packagelink (which is the input from the Trigger “when Package Link is updated”)
I’ve confirmed through an F12 inspect that the field ID above is for the Package Link field.
Where am I going wrong?