Dropdown menu how to filter double values

Hi all,

I made a custom dropdown menu with a RG in it. I works fine. But in the DB there are products from the same manufacturer. But I only want the manufacturer to be shown once in the dropdown menu. This picture underneath shows the dropdown menu with 2 times 2 values equal. That need to be one notation in the dropdown of the manufacturer regarding the amount of products.

image

Working on it now for quite sometime and I do not see the solution. Hope that you can help me out here.

Kind regards,

Dirk
Eck en Maurick
www.eckenmaurick.nl

Hi there, @Dirk-Ummy… if I understand your post correctly, try adding the :group by… operator to the repeating group’s data source, and add a grouping based on the manufacturer’s name.

Hope this helps.

Best…
Mike

1 Like

Hi Mike,

Thanks for the response. I tried it but no result yet. The dropdown comes up empty.

image

This is the RG. If I put in the :group by option the type of CONTENT turns to grouping. Still the datasource is bleu but no result. I guess I’m doing something wrong.

image

Regards,

Dirk

When you click on grouped by, did you set up the grouping there?

Hi,

Sorry, don’t know what you mean by that, set up the grouping there.

Sorry, Dirk

Literally click on the words grouped by in your screenshot and share a screenshot of the window that appears.

Hi,

Oke, yes I did.

image

Cool… I should have known from the other screenshot that you had set that up… sorry about that.

What is the text element in the dropdown displaying?

This is what is in the text element.

image

I believe that element has to reference the grouping.

Hi @Dirk-Ummy , If I understand correctly, you are trying to display a list of manufacturers here. If that’s the case, you can just show a list of manufacturers. So the RG data type will be manufacturer and data source will be 'Search for manufacturers". This is a much simpler approach. :slight_smile:

1 Like

Oh, wait… yeah… what @deejay.shani said! Ug, I was complicating the heck out of that thing… I gotta get some sleep. :slight_smile:

1 Like

Hahaha… It happens when it comes to Bubble. I re-learned this lesson a few days ago when I posted a question where I had complicated things for no reason. And then later I posted the solution myself when the reality punched me in the face :smiley:

1 Like

Hi Deejay,

Thanks for the info. But the manufacturers are in the database producten. If I put up a search in the RG I will get all the manufactures and that’s fine. But I do not get to undouble them. It still gives all the manufactures in the dropdown.

Or I’m I not understanding you correctly.

Dirk

Ah, so manufacturers aren’t in their own data type (they probably should be). So, you are back to the solution I was suggesting. Are you able to change the expression in the text element to refer to the grouping?

1 Like

Not yet. Somehow I ruined the complete set. I’m building it again.

It’s one of the best practices in Bubble to have data type for each thing, and then link the things together.
A manufacturer in this case is a thing and a product is a thing. You can have a separate data type for manufacturers in the db and then add a field in the product data type that is of type manufacturer. This approach will help simplify the app in the future.
Another use-case for this approach is if/when you have to gather analytics for manufacturers. For example, how many products each manufacturer has listed, how many were sold, which manufacturer sold the most/least products, which manufacturer is highest rated by customers etc. If you need further help, feel free to let me know :slight_smile:

1 Like

Hi Deejay,

We are looking to build a very simple wholesale app that just has a product and our client can order them. The data is provided from a B2C platform called Lightspeed. Bubble is filled with the data with Integromat as the enterprise service bus. To keep it really simple we made a data model in a google sheet the is 1 sheet with all the product sku, manufacturers, description, url of the picture, stock and the cost price. That’s it. Stock will be checked with an api to the rest api of Lightspeed.

We don’t want to have a platform that needs a lot of maintenance. That why we try to keep it to 1 user DB, 1 Product DB and 1 Order DB. That must provided a JSON with only email address and SKU number and amount. That is what we need. And why bubble because it’s web responsive. Our clients are young and modern sommeliers that work with iphone’s and samsungs. The big Lightspeed solution isn’t going to work. It sluggish on a mobile. It has to be fast and simple.

So I will proceed with Mike’s info and hopefully get it working. Not the case up till now.

But thanks for the input. I’ll really apricated all the info.

Cheerz Dirk

Hey @Dirk-Ummy … Thanks for sharing the details. It all makes sense now. I dug around a little and found the solution for you :smiley:

Please let me know if it works for you !

1 Like
  • Make sure to set the RG group’s Content type (first option) to Text.
  • Data source works something like this:
    Searches for products, then makes a list conatining each products brand (manufacturer in your case), and then filters the unique items from it. So if a manufacturer’s name is repeated 10 times, it will show up only 1 time in RG. Please note that this filter :unique elements only works on Text fields.
1 Like