Forum Academy Marketplace Showcase Pricing Features

[Solved] - Need Help with a Filtering Expression

I’m trying to create the correct expression to for the data source for my drop down menu. I want the data to be all the unique Vendor names from the ‘NewOrder’ type in the database. So far, I’ve only returned all New Orders, sorted by Vendor, with repeat vendors listed.

Here is a link to the issue in the public forum app:

https://bubble.io/page?type=page&name=a-new-page&id=forum_app&tab=tabs-1

What is the correct expression to just retrieve the unique Vendor names from the New Order type, in order to populate the options for my drop down?

Thanks,

Have you try to swap the order of unique and filtered? I think the general rule is to reduce the dataset as much as possible before applying filtering.

It might not help fix the problem, but should be more efficeint.

@DaveA, Thanks for your reply. Swapping unique and filtered still produces the same result: a list of all live orders sorted by vendor with vendor repeats.

Does the list of vendors work with only the unique operator. If it does, there is maybe a bug when they are both combined.

No, using only unique vendors gets the same result.

I think the unique is only acting on unique live orders, not unique vendors in the field.

What type of field is Vendor? Is it a text or another data Type?

Its a text field

Resolved with solution from @fayewatson:

Editor:

"I would create a new data type called Vendor, and a field within that data type called “Name” (to store the name of the Vendor). In the New Order data type, the Vendor field would be “Name of Field: Vendor, Type: Vendor, List: No” instead of “Name of Field: Vendor, Type: Text, List: No”.

Then in your dropdown, you can have the data type be Vendor, choices Sources be: Search for New Order’s Vendor, and Option Caption: Current Option’s Name.

I just updated the forum app example with the new fields. If you look at the New Order data type, the Vendor field now contains the the unique ID of the associated Vendor.

If you click ‘Primary fields’, you can change the Vendor data type view to display the Vendor name instead:

Which changes it to this:

It looks the same as when you had it, but it’s actually removing the duplicate data problem from before. If you go to the Vendor data type you’ll see no duplicates:

Now the dropdown will only display all of the Vendors connected to the New Orders."