Saving toggle value to database

Hello!

Need help.

So I am creating a new object, and one of the field is yes/no and I want to use toggle for it

how would I save toggle value to database?

Do I need to use state? Or how do I do it?

Thank you!

Hi Anastasia,

So you have a checkbox element on your page and you want to toggle the value in the DB based on its value?

Simply right click the checkbox → start new workflow → make change to the current thing → field value = checkbox’ value

Alternatively you can use autobinding on the checkbox.

Bests
Rob

i can make change to it using autobinding

however when i do not have the object created yet, how would i save this ionic toggle value?

it gives me either save yes either no but not ionic toggle value?

121212

so how can i save this value?

Hi Anastasia, you could either set the default value for that field in the Data tab, or set the initial value during the WF that creates that thing.

@aneejego

Thing
Active? (Yes/No)

Two flows:

Event: Ionic icon input value is changed (meaning someone clicked it) when thing active? is no
Make changes to thing active? Ionic value is checked

Event: Ionic icon input value is changed (meaning someone clicked it) when thing active? is yes
Make changes to thing active? Ionic value isn’t checked

The pictures are not exactly as above but hopefully they will still convey the above suggestion

1 Like

can I ask if I need to set a default value?

I see there’s none on your screenshot, but when is it smart do have it and when not?

I will try what you say now and reply! thank you

I am succeeding with autobinding but I am running into a problem here

So I am leaving toggle unchecked, but when saving it saves EMPTY value and not NO… how would i fix this behaviour the right way?

@aneejego

To set a default valué the toggle element can display it in different circumstances.

Here I have a an ionic toggle inside a group set to be a project displaying its value (last screenshot) of its yes/no active? field.

Choose “dynamic” on the first box (preset status) and go on from there:




I am trying to do it with a state now will reply if succeed

I succeeded with states and running every time here is a link to my sandbox

Any idea if there is a better way of doing what I did?

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.