I'm creating a script that reorganizes linked record field values across the whole base using alphanumeric sorting. I ran into something that looks to be a limiting factor from how Airtable works but would like to pose it to the community to confirm.
The script loops through each table in the base, grabs all records of the table, sorts all linked record field values, and then applies the updated records to the table.
The problem is that this works per table using updateRecordsAsync to apply linked record field values BUT the sort order of linked record field values in the linked table comes in randomly. In other words, sorting one table adversely affects the previously applied sorting to its linked table. When looping through tables to do a full base sort, this causes a table to sort and then unsort as soon as its linked counterpart sorts.
I have not found a solution for this yet and this is for a client with the requirements of a one-and-done sort script that I suggested initially. I created another copy of the script that sorts a single table but this would require resorting manually every time a different table is used.
One potential solution is creating an extension that watches the active table for changes and applies the sort to the current active table when this happens. I'm not sure if Airtable intends for extensions to be used as background workers like this though and whether I'd be able to post it to the marketplace. The other way to hand it off is making it open source which I'd rather not do for a solution I'm charging for... FAQ
Anyone have any ideas?
-Stephen