I need hel to fix my values list

Hello everybody. I need your help for a project that I’m developing solo and I’ve reached an obstacle:
is a product register, each product has a list of ingredients that make it up, their quantities and their values… My problem is: When the list of values ​​has two equal values, they are unified into an index, why does this happen?


In this case, if “easy” receives 2 in the input it will be 20 and the list will only have an index [20], my objective is to make it [20,20]

Hello, @P_Victor!
I didn’t quite understand. Because lists don’t allow equal numbers.

It’s kind of difficult to explain, but I need a list of values, you know? But I don’t know how I do it, this explanation was just what I managed to do on my own

E porque valores é um indice, se frango é um só, entao o preço é relacionado ao frango, nao sendo indice.

Please forgive me, but I didn’t understand correctly

@P_Victor! Why don’t you create the table, for example tb_produto - frango, preco 10. Why do I say this? Because chicken is just one, there’s no need to mark it as a list [for prices], unless you’re going to separate free-range chicken, frozen chicken, then they’re different values, but it’s still a price for each product, removing their items, which could then be a list of things for the chicken. Is this result of yours supposed to appear as? in a repeating group through a filter? The person searches for chicken and the list of products registered as chicken comes up in alphabetical order, something like that?

About my intention: It’s a product creation pop, the user creates a name and adds a list of ingredients that make up this product; There is already an ingredients table that has fields such as kilo cost and unit price.
The value that appears next to the ingredient in the repeating group is to know how much of each ingredient is needed to make the recipe, then calculate the price. Is the reason for the list clearer?

Hello, @P_Victor via Bubble Forum

Could you show me, in text format, what your database structure is? For example: I have two tables: a product table and an ingredients table. Could you send me the structure?

I’ll be waiting, and thank you.

Sorry for the delay in responding, I ended up falling asleep, but i’ll send my structure, wait please

----About the products and ingredients----
Table ingredients:

Name Amount Kg Price Unit Price
Frango 1 20 20

There is a column for unit of measurement, but I want to solve the problem first.
Table Products:

Name Applied Price Suggested Price Recipe Price List of ingredients
Sopa de frango X X Sum of quantity values from ingredient list [ Ingredient List from repeating group ]

Notes:

  • “kg” is a unit of measure in Brazil and it is aprox 2,2lb
  • I defined a column that it will recive a list (ingredient list in produtcs), maybe this can be a mistake, i don’t know
  • If you have some doubt, please ask me

Hello, @P_Victor! Let’s start from the beginning, I don’t understand your objective, this is a recipe book, for example: Recipe for Salpicão (this is the product) and the ingredients are: shredded chicken, grated carrots, mayonnaise and raisins. The price of this product is $25.00. Is that your objective? Or are you looking for the user to put together a recipe and have individual values ​​for each item? If you could explain, I would appreciate it.

Yes, that! The user will create the recipe for the product, following your example: To make Salpicão you need 200 grams of chicken costing R$5 and 100 grams of grated carrot costing R$5 as well… Therefore, the cost of the recipe for the Salpicão product It’s R$10

To do this, I thought about creating a repeating group to represent the list and calculate the value of the quantity of each ingredient to add to the recipe cost.

1 Like