I can write back to postgres with the "Bulk update via primary key" option successfully using:
Primary key column = member_id Array of records to update = {{table1.recordUpdates}}
But, I was also hoping to write a date timestamp to my database table to show when a row was last edited. Is there an easy way to do this with the "Bulk update via primary key"?
Instead, I've been trying to use the "Update an existing record" option
So technically this query updates a single record according to your action type: "update an existing record". In order to get it to update for several changes, you will need to create a separate javascript function and loop through the recordUpdates and trigger this write_alterwood_table query with the additional scope of each element that has been updated passed in.
I'm currently using a transformer to add the extra fields that I want to write back to my postgres table. Below is the transformer and "member_table" is my table in Retool where edits have been made. I'm using _.pick only because I wanted to write back only a few of the columns that exist in member_table.
Hey @Magenta_Jackie! Somehow I missed the notification for this. I was randomly looking up a different issue and came across this thread/my question.
Your solution works perfectly! This is the first time I've used a bulk upsert + an array of records and it's definitely pretty powerful. Thanks so much!