# Keeping duplicate objects in a list

**URL:** <https://forum.bubble.io/t/keeping-duplicate-objects-in-a-list/84682>\
**Category:** Need help\
**Created:** [April 3, 2020, 11:55am UTC](https://forum.bubble.io/t/keeping-duplicate-objects-in-a-list/84682 "2020-04-03T11:55:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rik.raut98](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/rik.raut98/32/57459_2.png) [@rik.raut98](https://forum.bubble.io/u/rik.raut98)\
**Post date:** [April 3, 2020, 11:55am UTC](https://forum.bubble.io/t/keeping-duplicate-objects-in-a-list/84682/1 "2020-04-03T11:55:24Z")

</div>

![Screenshot (56)](https://us1.discourse-cdn.com/bubble/original/3X/2/e/2eb5816d0027667a4344eebf4a706067316ef479.png)

Hi! So I am extremely new to Bubble (like 6 days new) and I’m trying to store values from a database as a list. However, the list won’t accept duplicate values. As you can see, I tried to test my app by buying 2 of each item. So the entry under Qty would have been (2,2,2). I’m sure the same problem will be there if the prices became the same. Is there a workaround? I am really stuck and need some help.

PS: I am trying to build a small-scale ecommerce app to help people in my locality during the covid crisis.

---

<div class="post-metadata">

**Author:** ![NigelG](https://avatars.discourse-cdn.com/v4/letter/n/ea5d25/32.png) [@NigelG](https://forum.bubble.io/u/NigelG)\
**Post date:** [April 3, 2020, 12:42pm UTC](https://forum.bubble.io/t/keeping-duplicate-objects-in-a-list/84682/2 "2020-04-03T12:42:16Z")

</div>

Welcome to Bubble.

Keeping list of “related stuff” in multiple lists is not the way forward.

Create a new data type called “item” (or whatever) and have the description/price/quantity on there.

Then have a field called “list of items” (or whatever) of type Item and tick the “this field is a list”.

If you haven’t done so already, the tutorials will show you how lists work.

---

<div class="post-metadata">

**Author:** ![patricia](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/patricia/32/57583_2.png) [@patricia](https://forum.bubble.io/u/patricia)\
**Post date:** [April 3, 2020, 12:45pm UTC](https://forum.bubble.io/t/keeping-duplicate-objects-in-a-list/84682/3 "2020-04-03T12:45:53Z")

</div>

I would …

Create a table called _Items_ with a field _Name_ and a field _Quantity_ and a field _Price_ - it would also be helpful if you added a field called _Transaction_ so you can cross-reference from one table to the other - makes life easier.

In your _Transactions_ data table add a new field called _OrderDetails_, make it of _type Items_ not text, and check the _List_ checkbox.

When a user orders, _Create a New Item_ with the fields Name & Price & Quantity filled in for each item they order. Then in your _Transactions_ table add that _instance of Item_ to your list in the OrderDetails field. Finally, add the _Transaction instance_ to the Transaction field in the _Items_ table.

Which is effectively what @NigelG just beat me to saying 🙂

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/bubble/original/3X/2/8/2847faa74692c2ffa5d939d3dc3724cdd060d247.png) [@system](https://forum.bubble.io/u/system)\
**Post date:** [June 12, 2020, 11:55am UTC](https://forum.bubble.io/t/keeping-duplicate-objects-in-a-list/84682/4 "2020-06-12T11:55:25Z")

</div>

Closed on June 12, 2020, 11:55am UTC

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