I am trying to write multiple new records to a table. The docs suggest doing this like so:
table.createRecordsAsync([{'My field name': '1'}, {'My field name': '2'}, {'My field name': '3'}]);
In my code I have the following test:
table.createRecordsAsync([{ 'Name': "Dave"}, { 'Name': "Sam"}])
But I get the below error:
invalid record format. please define field mappings using 'fields' key for each record definition object
As a check, I also attempted to write a single row, like so:
table.createRecordAsync({ 'Name': "Dave"})
And this worked fine.
I also attempted this:
table.createRecordsAsync([{ 'Name': "Dave"}])
And I got the same error as before. So it seems to be something about the createRecordsAsync method and passing an array.
Any ideas?