Showing list name and value by highest value

Hey!
So I would like to build this.

Basically, the user inputs a value from 1 to 5 on these specific vegetables, and then on the right the top 3 will appear.

I’ve been able to store the inputs on the DB, but not so lucky at displaying the top3. And I’ve tried multiple ways with the database, all together, separate, linked. But did not work.

Can someone explain to me what I’m doing wrong?
Is it the database, or logic?

Would really appreciate your help.

Hello @samuelgraciopedro Welcome to the community!

How about sharing some screenshots how what you have so that folks can better understand (including me) where you are and provide suggestions :smiley:

Thanks @cmarchan
So, I have the front-end built like this, not sure if the right group should be a RG?

And this is how I’ve structured the DB, basically retrieving the inputs (scores) of each vegetable, which also poises a challenge to later display the name in the right i.e Carrots 5 (I think :face_with_peeking_eye:)
Captura de ecrã 2023-12-29, às 14.07.54

Does this help?

Dealing with ranges is certainly trickier. Perhaps it would be better to change the scores to type number

I see this functionality resembling how a shopping cart works. You choose products and create line items in an order. 3 dataBase objects involved. The lineItem holds the chosen quantity of the product.

Try and see if the above can be adapted to how you want things to work in your dB model

I’ve tried with numbers, instead of range but it did not work.
This is - I’m able to retrieve the data and store the scores as numbers on the DB.
However, the challenge is putting/displaying the scores in the RG in order with the name of the vegetable attached.

I’ve tried to divide the two data types (vegetables and scores), but it also did not work.
But what you are suggesting is to create:

  • data type - vegetables (name)
  • data type - scores (score - how do I connect it to each specific vegetable)?

product

  • title (text)

lineItem

  • score (number)
  • product (product)
  • cart (cart)

cart

  • lineItems (list of lineItems)

Two repeating groups next to each other

Rg1 products
Rg2 lineItems

Logic

  • user enters a quantity for his/her preferred products
  • he/she can click a button that says “cart”
  • onCartButtonClick create a cart and right after use the non-empty scoreInputs to create the respective lineItems recursively and relate them to the cart
  • add those lineItems to the list of lineItems in the cart

The above names resembling a cart experience are for illustration purposes

Hope the above helps! :smiley:

@cmarchan Can I use your https://tidycal.com/ link to schedule a call today? I would be happy to engage in a small consultancy if needed :wink:

Certainly! :smiley:

@cmarchan Thank you. See you in a bit

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