Connect dropdown to JSONB field in table. Works as key value pairs, not as form object

Actually I'll solve this before you get back to me. One incredibly useful function of the retool forum is that it suggests other posts based on the contents of the post you're on. This led to me to another post with someone having a similar issue with bulk updates on Google Sheets. I modified his solution to match my table and column and bulk updates work properly now.

In my examples the field "cert" is the field containing an array that will be inserted into a JSON field in the database.

Solution for bulk inline edit (sources from "Tags" field in table)

{{tblJobs.changesetArray.map(change => ({
  ...change,
  certs: JSON.stringify(change.certs)
}))}}

Solution for passing form data object to insert (sources from Multiselect in form)

{{ 
  Object.assign({}, frmJobEntry.data, { certs: JSON.stringify(frmJobEntry.data.certs) }) 
}}

The post I'm referencing is here:
New table tags array not saving to Google Sheet - App Building - Retool Forum

1 Like