List of current order items only shows the last one

Hi I’ doing a simple order app where the user chooses a product from a card list and a create order action is invoked. They then choose a quantity from the next screen and the order is updated with this info when the user hits the “add to your order” button. The next screen contains a summary list of the ordered products. My problem occurs when you link back to the home screen to add a 2nd or 3rd product to your order. All records will show up in the Orders collection but only the latest one will show in the summary list. I’ve attached a screen shot- any help much appreciated:)

you should create a new collection of “order items” have a relationship of one to many (one product many items)
then when a user wants to create an order ask them to choose products, everytime a product is selected a new item is created taking all the product’s infos and is being related to the order directly,
relationship between order and items is one to many (one order many items)
this way if a product is no longer available and deleted you won’t have empty old orders too
so it solves two problems at a time

1 Like

Many thanks for this. Yes I saw the order items collection in the template app but with no user attached I didn’t see the point in it. It also seemed redundant to me because the properties of the order items collection are the same as those of the orders collection. But no matter I’ll go back and review the template app- thanks again:)

great, you’re welcome

Hi again I’m still struggling with this. Here’s a visual- again any help much appreciated:)

Forgot to mention I’m filtering the summary list by current order item. If I don’t filter it then all order item records in the collection will appear:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.