Forum Academy Marketplace Showcase Pricing Features

Simple App add numbers help

I’d like to create an app that has buttons with a value and when the button is clicked, add the value of the button to increment a progress bar. The problem is I can’t seem to figure out how to create a variable to store the incremented value in.

Any help would be greatly appreciated!! Thank you.

You can use the “Create a new thing” or Change a thing actions if you need to keep the value from one run to the other, or a custom state if you don’t need to store it.

I tried that but couldn’t figure out how to actually add the numbers together. Would it be possible for you to share an example? I don’t need the values stored just added up for the current run.

Thank you.

Here we go …

The number is stored on a “customer state” called number that is attached to the page. It is defined a number so you can do some maths on it.

4 Likes

@NigelG, this is soooooo amazing, thank you for sharing! I was just wondering how I would figure out how to do this, and the link/demo was super super helpful.

Now, my next question is: is it possible to get bubble to dynamically create the buttons like in your app, so that there could potentially be an unlimited number?

The idea is that I am creating a ‘register’ type system for my delivery cleaners. I want to be able to add new products, which have this functionality. So far, it looks like the image below:

each of those squares is a group. It contains the button titled ‘product…’, the text display in the lower left corner of each square, and a subtract button opposite the numeral display. When the button ‘product…’ is pressed, the display updates by 1.

I would like my app in bubble to recreate unlimited numbers one of those groups, with a custom text on each button, so that I can replace ‘product…’ with the name of a specific product on each button.

Thank you again for all your help on this forum. I am learning so much.

Yes, I think you would need a repeating group to display “unlimited” buttons, but then you need a custom state for each one … which would be interesting. If you can get away with holding the number on the database it would be easier.

The custom state, would that be referring to the title of the button, or to the work flow which starts it at 0?