I’m using code found from this post and am struggling to figure out how to get past an error of “Error: Field “fldJl8IjqgJizFULv” cannot accept the provided value.
at main on line 29”
The goal:
Separate a list of records into separate records to input into another table along with assigning fields of “Projects” and “Status”
What I’ve tried:
I’ve performed the script successfully with creating a record with the task name for each task, but when I try to define other fields I end up getting the error mentioned above.
Here’s my code so far. Any help is appreciated! I’m so close to getting this, just need a bit of help to the finish line
console.log(Hello, ${base.name}!
);
let inputConfig = input.config();
console.log(The value of ProjectType is ${inputConfig.ProjectType}
);
console.log(The value of ClientName is ${inputConfig.ClientName}
);
console.log(The value of TaskName is ${inputConfig.TaskName}
);
// pick tables from your base here
let projects = base.getTable(‘Projects’);
let tasks = base.getTable(‘Shop Tasks’);
// define input variables
let TaskName = inputConfig.TaskName
let ProjectType= inputConfig.ProjectType
let ClientName = inputConfig.ClientName
// create the tasks - change the field names to ones from your base.
// Split records in find records step into separate tasks
let updates = new Array
for (let i = 0; i < TaskName.length; i++){
updates.push({
fields:{
“Name”: TaskName{i],
“Status”: “Todo”,
“Projects”: ProjectType + “-” + ClientName,
}
})
}
while (updates.length > 0) {
await tasks.createRecordsAsync(updates.slice(0, 50));
updates = updates.slice(50);
}
console.log('The value of tasks is ',tasks)