Checkbox value query question

I have a card collection view component that contains a checkbox.
This checkbox is synced with the column "BeingPaid" out of the table "Userss".
However, I want to change the checkbox at my page and at the same time the database.
In SQL queries I can use {{PaymentOverview.SelectedItem.BeingPaid}}, but of course that is the current data and not the just changed check mark.
I know you have temporary states and all, but I still don't know how to combine that with my case.
Anybody tips and tricks?

I have used queries like this:

UPDATE "Userss"
SET "BeingPaid" = {{GroupPaymentOverview.selectedItem.BeingPaid}}
WHERE "id" = {{ GroupPaymentOverview.selectedItem.UserID }};


UPDATE "Userss"
SET "BeingPaid" = (CASE WHEN {{GroupPaymentOverview.selectedItem.BeingPaid[0]}} = 1 THEN true ELSE false END)
WHERE "id" = {{ GroupPaymentOverview.selectedItem.UserID }};

After this query I refresh the query "AllIndividualBills" as seen in the picture in the top right corner.

Hey @Luc!

It looks like the current checkbox values are stored in suffixValueByIndex:

You might be able to use this property along with a checkbox press handler to update your DB:

This may not be the cleanest solution but using something like {{, i) => Object.assign(row, {enabled: collectionView1.suffixValueByIndex[i]}))}} seemed to work for me (my checkbox column was named enabled):

Does that work for you? I'm also curious what some other takes on this might be!

Thanks for your time and help. But the problem still occurs :frowning:
Don't know what to do.

:thinking: would you mind if I stepped into your app to take a look directly? Otherwise, it might help if you could post updated screenshots of your current configuration!

Hey Kabirdas,

Somebody also from Retool helped me out!
Thanks for your help.
I still learned from that!

Greetings Luc

Oh, great! Would mind sharing here what the solution ended up being? Curious to know what it is :face_with_monocle: