Removing duplicate items from a repeating group?

I am relatively new to Bubble and started designing without too much of a plan… I am now at the point i wanted to upload 1000+ items into my database and realizing I have not set myself up properly.

Here is an example of the data set I am working with:

What I am trying to accomplish is rather than having my inventory items display like this:

I would like all of the duplicate inventory (i.e. Dasani’s) to display only once. Once clicked, the the various sizes available would display as options like this:


I can accomplish this by having all of the sizes of Dasani in one entry, but then I create the problem of how to display the price based on the size selection.

Any suggestions??

Your main RG will use the :unique elements limiter.
Then create a smaller RG within the group of the main RG to show the sizes.

1 Like

Once the customer makes there selection for flavour and quantity they “Add to Cart” which creates a new “Cart Item”. If I am using a smaller RG within the main RG how can I also set the price of the “Car Item” based on the users size selection?

Within that smaller RG, insert your text elements into a group. Then when that group is clicked, do some workflow action to add the cart item and use “this group’s price” as needed.

My issue seems twofold now with price and duplicates…but first things first.

This is what i have for the main repeating group but I am still getting duplicate items. I’m assuming it is because technically they are all unique “Inventory” entries. I tried using the Inventory’s Description:unique elements but that didn’t work because that repeating group needs more than just the inventory’s description. Is there a way to do this using Search For constraints?

ah, that is a data structure issue.

Option 1:
Create a data type for the Product (which is at the description level), and then a separate one for the Sku which is at the price level. Then you could run your main RG on the Product with no risk of dupes.

Option 2:
Within your current structure, add a new field to the product called something like “UniqueFlag” to be a yes/no. Then you can set Unique Flag to yes for one record for each of your products, and then add a constraint on your RG for UniqueFlag - “yes”.

Option 1 is best practice, but given where you’re at option 2 is quicker.

Actually, I’m not sure that my option 2 will work… reason is (I believe) that there will be no way for you to link the main RG to the sub RG.

Yes, you need to reduce the grain of your select and then re-explode. Here’s how:
-Make the type of your content something simpler, like just text (or product name or sku if you’ve defined it as a type)
-Make your search for inventory’s sku (or name, whatever uniquely identifies the product
-Then make "unique elements
-Then within each cell, each cell becomes a “do a search for”, where you re-search for the parent’s additional attributes
(Such as do a search for inventory (contraint: sku = current cell’s text/sku), then you can reference all of the attributes for forming the cell structure

As for pulling the user’s choice out of multiple cells (such as choosing different sizes of different inventories to a cart, you’ll need a plugin

1 Like

Search for RepeatingGroup Tools (bdk) from plugins. A slight learning curve (you’ll need to view the demo projects in the editor to get it), but it should work.

Thank you both for your help! I think i am a bit over my head with this one…in the interest of time I might be best off trying my luck in Freelance to help.

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