Hey, so I am struggling here trying to figure out a solution for this problem, and I am hoping someone can help me with this.
So I have a datatype called Products. In this datatype, I have the following fields: “Product Supplier,” "Product Name (List), and Product Price (List). So Product Supplier A will have products such as Product A1, Product A2, and Product A3, and also the Product Price List will have a bunch of Prices named Price A1, Price A2 and Price A3. So, my issue is I want the Product names to show their correct prices on the front end. What ends up happening is all of the products show the first price, which is Price A1, I think this is because I set it to First Item, but my question is, what option is there where I can tell the Price field to basically look at whatever is in the Product Name field and whatever number it like number 2 on the list then it would show the number 2 price in the Price field.
In the screenshots attached, you can see how the database entries look like so Product A1 should = 100 and Product A2 = 200 and Product A3 = 300, however in the second pic, you can see in the front end when product A2 is selected is shows 100 when it should show 200 in the rate column. I’ve also attached how I set up the dynamic content in the Price field.
I apologize if my question does not make sense. Please let me know if anyone needs me to clarify something. Any help would be greatly appreciated!
Hi there, @no-reply… if I understand your post correctly, it doesn’t sound like you have any constraints on the search for products, but it sounds like you need a constraint where the product name is the product name dropdown’s value. Also, it looks like you are using a multi-dropdown for the product name, but it doesn’t seem like a user should be able to select more than one product there. Is that correct?
Yes so I setup the multidrop down to only allow one selection. The reason I used the multi dropdown and not the regular dropdown is because I wanted the search feature and the ability to add more items.
also sorry my image was not clear, attached is a more clear image of the constraints, so the Product Name is a list so right now it’s set to show whatever the input is in the product filed (where it currentlly says Product A2) So this way when a user selects product A2, the price field should look at that and get the price from that.
Why are the product name and product price fields lists? I assumed that because you have a product data type, each product is its own thing in the database.
No so each product is not it’s own thing. Does it need to be? The reason its not is because these items are specific to a user and so I wanted all of each users products to be in one datatype. Essentially if I could just somehow just tell bubble to look at what Product is written in the Product Name field and field and find out what position it is on the like the 2nd position and then basically look at the price list and display the 2nd item in that list.
Well, I definitely wouldn’t do it the way you are describing, and one of the reasons is exactly the issue you are running into. If each product is its own thing, it would be easy to do what you are trying to do. The dropdown would show a list of actual products (not just their names… but the names would be the display), and referring to the selected products rate would be super simple.