Running an update query on a normalized data model

Hi,

Exporing Retool for one day now i found this solution for updating a record of a table based on a query on de the Retool db. However i have normalized data model hence the update value needs to be collected first in another table to update the foreign key correctly. Any suggestions on how to do that?

Thanks in advance

I'm newbie here, but it sounds like some Javascript Transformers, to transform the data before running the DB query, would do the trick for you.

Hello, pls check this topic. Hope can some help.

Thanks for the suggestion. Will look into that.

Hi Anson,

If i understand correctly i can use additionalScope to add data to the changesetArray. And update multiple values to the database. That's great! Will give that a try.
One question that rises: is there a way to avoid the default save button after a cell change and use component to trigger the batch update??

Thanks again!

Hey @shiftd! Not sure if you were able to get this resolved but if you're referring to this modal:

It can be removed by deleting the save action from your table:

If you're triggering the bulk update and refresh query from a separate component you should be fine without it!

Hi Kabirdas,

Actually my use case changed a bit and the data source changed to a REST service.
Thanks for pointing this out though... Will keep it in mind in future explorations.