Hello Community!
I’d love some guidance on a script error that I am receiving while updating a record.
I have a table that gets refreshed every day with physician work shift data. The refreshed records contain the physician’s NPI value (single line text) as a text field and I want to populate NPI Reference (Linked field) with this same NPI value using a scheduled automation script.
When I run my script, I receive this information:
CONSOLE.LOG
“Copying NPI 1316340000 into record id recHQVgBpFoVSezTP”
ERROR
Error: Field “NPI Reference” cannot accept the provided value.
at main on line 12
Here’s my script:
let Shifts = base.getTable(“Shift Schedules”);
let shift = await Shifts.selectRecordsAsync();
// loop through the records
for (let record of shift.records)
{
if (record.getCellValue(“NPI Reference”) == null)
{
let recordID = record.getCellValue(“Record ID”);
console.log(Copying NPI ${record.getCellValue("NPI")} into record id ${recordID}
);
await Shifts.updateRecordAsync(recordID, {
"NPI Reference": record.getCellValue("NPI")
})
}
}
Thank you for your help!
Doug