When input is negative how to override initial content

Hello!

I want to do something pretty simple but can’t seem to figure it out.
When an input’s value is negative I want to override the input to show as 0.

Thanks!

1 Like

Hello @martabarreiracalvinh

Consider the following:

Hope this helps! :+1:

Hello!
Thank you so much for the reply.
I tried what you did and it didn’t work for me.
Did I miss something?
Screen Shot 2020-12-02 at 2.07.21 PM

This is my first time using custom states so not sure what to do

I added that and still no luck…
It still shows the negative number…
Could it be missing something else?

Really appreciate the help. Thanks!

EDIT:
Maybe it could be related to the fact that the page loads and its already a negative number and in that flow it is saying to make it zero when the value changes but its not actually being changed? Not sure…

It does work. Please see this GIF:

Screen Recording 2020-12-02 at 09.02.41.57 PM

Yes, so that works because you are inputting it in the moment.
In my example the user answers questions and it saves it on the database as negative.

What you are showing me there is a live input of a negative number that becomes 0. But in mine since it’s already negative there is no change and so it doesn’t become zero…

Mmmh … my understanding was wrong. Very sorry for that.

Are those inputs inside a repeating group?

No, they are not.
Here is a link to it:
You answer questions in page 01 and 02


and then you get the results in https://5yrplan.bubbleapps.io/version-test/results

Under the “Debt” Section…If a user starts off with 10,000 in debt and then pays off 5,000 in year 1 and year 2 then at year 3 they would then go into -5000…so then I want it to go to 0. At that point it would also then tell the “Avg Expenses” section to stop taking out 5,000 every year into that category because it’s reached 0.

Does that make sense?

In the flow that makes the calculation … restrict it from sending negative values.

Best of luck with your app :+1:

Great that is exactly what I want to do! Where do I input that restriction? Sorry, still learning!

All events and actions have this area to apply conditions:

image

OH I got it now! I was just applying the conditions to the wrong place. Did it on the workflow saying if it is bellow 0 then show 0 and it worked perfectly.
Thank you so much for your time.

1 Like

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