Forum Academy Marketplace Showcase Pricing Features

Checkbox with Dynamic state

Hi,

I’m using a form to edit user’s profile and some of the fields are of yes/no type.
I’m trying to use checkboxes to get the work done and I’ve set its content to be Dynamic but they are not updating de user’s database… On the other hand, it’s not possible through the workflow “Make changes to the current user” to do the job since the checkbox value doesn’t appear… help would be great!

To store the check box value, what to do is ‘thefield = CheckboxField is yes’, that way it will store a yes if it is checked. you can of course use the is no, if you want to store the opposite meaning of the check etc. So, you basically use a log check response to get the value.

e.g.;

1 Like

Thanks Dave. Do you mean in the Make Changes to the current user’s workflow?

Yes, anywhere you want to write to the database. That is what I am doing above, in a Make changes to a thing workflow.

Right, thanks. However, it has to be done for both values, yes and no.
So Dynamic is just reading the initial value from the DB. It’s strange though that checkboxes don’t update Db’s the same way other input types do. Imagine the workflow when making changes to current user with a dozen checkboxes…

Why does it have to be done with both values?

It is a logic check,

Check box ticked => Field Value = Checkbox is Checked=> Stored value is Yes.
Check box not ticked => Field Value = Checkbox is Checked=> Stored value is No.

Only 1 test to cater for both cases.

Situation 1: the checkbox reads and shows “no”/unchecked from the database. User checks it. Your test forces a change to the BD to “yes”.
Situation 2: the checkbox reads and shows “yes”/checked from the DB. User unchecks it. Your test does nothing to the BD.
Am I missing anything?

On the Dynamic field for display purposes, you do not need the logic check, you only do that on the workflow to set the status in the db.

After you set and save the status, remember to reset the input field.
See this very basic demo (runtime): https://dave-auld-demo-stuff.bubbleapps.io/version-test/blog/

editor: https://bubble.io/page?type=page&name=blog&id=dave-auld-demo-stuff&tab=tabs-1

Thanks Dave. It looks like we are doing different things. Thanks for the demo.