I’m building an app that updates a data table. I can’t find a way to create new rows in the table based on a variable (ie, on row per student and the number of students is a variable). The documentation says createRecord can’t be in a loop because of the callback. But, there isn’t a createRecords function that takes an array of objects, similar to how readRecords works. I tried a Javascript function that isn’t part of App Lab (this sometimes works), but App Lab said the function wasn’t defined. My only option, it seems, it to hard code the number of students and the number of subjects and use one createRecord at a time, but that hurts me to write such awful code. Is there a way to create multiple records based on a variable in App Lab?
There is no technical reason you can’t use createRecord in a loop. It is just inefficient to use a function expression. To get around that define your callback as a named function and use that instead of a function expression.