Forum Academy Marketplace Showcase Pricing Features

Displaying dynamic data not in the database

Hello everyone!,

So, I am working on creating a fast-food style invoicing system for my cleaning business. Right now, I am able to get an awesome set of buttons to display which represent items we charge for. Each time I click the button, a counter at the bottom goes up by 1 and there is a minus button to delete one if needed. And it is based of a product list entered into our database, so the number of these buttons can grow/expand as needed with our business.

The problem I am running into is generating the invoicing system off of this. Basically, I have the number displaying at the bottom of each button. But, I need to get the product and that number to display in another repeating group that I use to build my order then save it to my database with customer information.

Here is how the app currently looks:

The ultimate goal would be to get the items that do not have zeros to show up on the lines of the repeating group to the right. The items with 0 don’t show up at all. Then all the information gets added up and an order can be created in the order database.

The ultimate goal is to get a system which resembles and functions like the one below:

In the editor that I currently have set up is below. It doesn’t necessarily need to be set up this way, just what I started with before I realized I had no idea how to proceed.

Thank you!

One way to do this would be to add / delete items from your database as users add / subtract them. Then, set the repeating group to be based on that database table.

If you don’t want this stored in the database (event though it sounds like something you’d probably want to store) then you may be able to use a Custom State to store this information client side and have that referenced by the repeating group.

Note - You’ll want the final set of information to be stored in your database for sure because if it’s only client side then technical users can manipulate it / game the system. Since it’s tied to payment, I can’t imagine that’d be an okay scenario.

Best of luck!

2 Likes

Right now, there is a list of products database, which is what the button displays are reading.

If the numbers were saved, it could be in a separate data base, correct?

Also, the final product could be saved in an entirely different database solely for the tracking of orders, correct?

Meaning I could create a database whose only purpose is to hold the data temporarily, and keep all the other databases pretty tidy.

Nice, I can dig that, thank you!

So if I understand you correctly, I would essentially need to add a work flow that says to modify the thing created in that database. Now, my concern is that seems horribly inefficient, to use 10 work flows because I might need to get the number up to 10 because a customer had that many items.

I guess the only way around this would be to have a save button that tallied Everything at once, but then I’d lose the functionality of having the numbers show up in the invoice area automatically.

Is this a correct understanding?

Yes, that’s correct.

My take is that I won’t optimize too much on # of workflows. I know if you get too high you’ll have to get a higher plan on Bubble. That being said, you get hundreds of thousands of them for a (couple) hundred bucks a month so I wouldn’t sweat the details. Generally better to build something that customers want and will pay for. Just my general opinion, of course some people’s scenarios may diverge from this.

Yes, this is correct.

One piece of termonology – The database usually refers to a set of many tables, where each table has a number of fields. So, when you say “database” I think you actually mean “table.” Just FYI, since it may help you understand people’s explanations more precisely.

1 Like

Yes you are right, thank you for clarifying that.

Excellent, excited to give this a try, thank you!

1 Like

Ok, struggling with this again, and haven’t made much progress. Here is what I got so far based off of this conversation:

The obvious problem is that every time the button is pressed a new thing is created, with a new value of whatever is displayed in the box at the corner of the button. This is fine, except the invoice list not only displays the current number, but every other number leading up to it.

I was really hoping I could do something slick with custom states like I did with the counter display at the bottom corner of the buttons. Unfortunately, I can’t seem to find these text boxes as options when they are in the repeating group. If I take them out of the repeating group, I can just fine… but I need the repeating group.

In this case I opted to just go with the creation of a thing. Some how, some where, I need to add a condition to only show the :max of a particular field. However, that might not work either because there will be different items, and they all will need to display.

Also, how does the ‘delete a thing’ work flow actually work? I tried adding one that might delete everything but the max for a particular product, but I can’t seem to set it to a particular table like ‘create a thing’ does.