Hi!
I'm building a personal finances app on top of my Airtable database and I've ran into a problem with updating records in Airtable.
-
Goal:
I want to change values in specific cells (transaction categories) inline and update them in the Airtable database. When I do this in the editor, the records update correctly. However, in user mode, Airtable updates with the first assigned category correctly but then uses that same value for all other transactions, regardless of what I choose in Retool. -
Steps: I've built a query
update categories
, which calls Airtable's API using the PATCH method. The body useschangesetArray['0']
for pulling changed values. It is triggered by a "Click cell" Event -> "Control query" Action and "Trigger" Method. -
Details: Here's the request made to Airtable:
https://api.airtable.com/v0/{table_id}/{{to_categorise_tb.selectedRow.id}}
And here's the body:
{
"typecast": true,
"fields": {
"category": "{{ to_categorise_tb.changesetArray['0'].category }}",
"type": "{{ to_categorise_tb.changesetArray['0'].type ? to_categorise_tb.changesetArray['0'].type : to_categorise_tb.selectedRow.type }}",
"if_split": "{{ to_categorise_tb.changesetArray['0'].if_split }}"
}
}
It shows correct data when I check it in the preview mode.
- Screenshots:
Here's an example. The records are in reverse order, but you can see that the assigned category in Retool "Zakupy Domowe" was also applied in Airtable to the second transaction, which should have a category of "Zwierzęta."