Inserting data based on yes/no

Hi Guys, new here! Loving the platform so far.

Currently i’m stuck with the following.
I have some checkoxes and dropdowns the user can choose, and these choices get saved in a database. So far, so good.

One of the fields is a yes/no. What I’m trying to do is when the value of one field is “yes”, another field in the database reads 1, and if “no”, it reads 0.

if Pepperoni = Yes, then pepperoni_price = 1, else, pepperoni_price = 0.

The pepperoni_price value is then taken from another table (“extras” table):

So the logic would look something like: whenever Pepperoni = Yes, then pepperoni_price = Do a search for extras extra_price where extra_type = Pepperoni.
Otherwise pepperoni_price = 0 (or blank)

Thanks all in advance! :slight_smile:

I managed to figure it out. I set up the workflow in a way that it firsr adds the basic ingredients and the next couple of events update the last added item based on the conditions needed.

You could also use the :formatted as text option via dynamic data

So <something resulting in 1 or 0>:formatted as text can give you “yes” and “no” as the text result.

Ranjit from Atomic Fusion

Explore and reuse the community’s Bubble assets & Accelerate your Bubble development with Atomic Fusion

1 Like