Number Value from Dropdown Issue

Hello, im having a set of dropdown that have a number value from 1-10, and when the user select product1 then chooses the quantity (dropdown) of 1, then proceeds to product2 and picks the same quantity as 1, in my database i have a field type that is set as list of numbers. And in my database it only appears as 1, but i need to show up as 1,1. How can i solve that?

You should have a data type called Line Item that has a Product field (Product) and a quantity field (number). Then, you’ll store a List of Line Items cart/invoice/order/whatever.

1 Like

Thats exactly what i have, but my results into the database for 2 similar quantities is the same, 1. I’ll upload a screenshot

Here, i have an order of 3 product, 2 x Product1, 2xProduct2 and 3 Product3, but instead of 2,2,2 i only have 2,3. It outputs and unique elements and i dont know why because in my database i have set it up as a list.

It’s evidently not what you have.

None of this makes sense, I think you got your numbers messed up.

Lists in Bubble cannot have repeated items (for a list of 1,2,3,4,5, doing List:plus item ‘4’ will mean the list is still 1,2,3,4,5 as opposed to 1,2,3,4,5,4)

Ok, i understand that it doesnt work that way. So how can i get my desired result into the database? If my input for nr of products would be for ex 1, 1, 2

Your setup is not correct. Here’s some guidance on how to set this up:

You’ll need 3 datatypes:

1 - product: this will store info about the product such as name, description, price, sku, etc

2- line item: this will store the product datatype (so you can reference information about the product such as name, description, etc) as well as line item information such as quantity, price (qty*this line item’s product’s price), line item discounts, etc.

3- Invoice: this can store a list of line items (alternatively you can only store the invoice id on each line item), discounts, tax, total, etc.

1 Like

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