Is the return order of row ids guaranteed after adding records?

I have csv bank data that I want to upload to my document via the API. In Grist, this should be stored in two tables: Transactions and Splits. Some data ends up in Transactions, the other in Splits which also contains a reference to the corresponding data in Transactions. I can easily achieve this by going through every csv row at a time, adding the first record and using the returned id as a reference.

To be more efficient and safe, I want to use bulk operations instead. So my question: Is the order of ids returned in the response by addRecords guaranteed to be the same as the payload in the request body? If so, I can merge the return list of new Transactions records with the list of Splits records to add and only need to do 2 API calls.

Yes, it is the same!

1 Like