Hi all,
I have a form which sends data into a grid view. One of these columns has 7 options as a single select each with a rating number followed by a rating name. I created a column within the grid view that runs a script I wrote which essentially checks the input column and isolates the rating number in the new column for quick data pulls. However as our form inputs increase, I created an automation that would run this script every time a form was submitted and lately I have been getting the 15 mutations error. Would anyone be able to help me review my code and see if I wrote an unsustainable program?
let table = base.getTable("Intakes/Submissions");
let view = table.getView("Partner Creator Survey External");
let csat = await view.selectRecordsAsync({fields: table.fields});
for (let line of csat.records) {
let csatRating = line.getCellValue("CSAT Creator");
switch(csatRating.name) {
case "1. Very dissatisfied":
await table.updateRecordAsync(line.id, {"CSAT Score": Number(1)});
break;
case "2. Dissatisfied":
await table.updateRecordAsync(line.id, {"CSAT Score": Number(2)});
break;
case "3. Somewhat dissatisfied":
await table.updateRecordAsync(line.id, {"CSAT Score": Number(3)});
break;
case "4. Neither satisfied nor dissatisfied":
await table.updateRecordAsync(line.id, {"CSAT Score": Number(4)});
break;
case "5. Somewhat satisfied":
await table.updateRecordAsync(line.id, {"CSAT Score": Number(5)});
break;
case "6. Satisfied":
await table.updateRecordAsync(line.id, {"CSAT Score": Number(6)});
break;
case "7. Very satisfied":
await table.updateRecordAsync(line.id, {"CSAT Score": Number(7)});
break;
case "8. Not applicable":
await table.updateRecordAsync(line.id, {"CSAT Score": Number(8)});
break;
}
}