# Filtering option sets for use in a dropdown

**URL:** <https://forum.bubble.io/t/filtering-option-sets-for-use-in-a-dropdown/122981>\
**Category:** Need help\
**Created:** [November 26, 2020, 1:39pm UTC](https://forum.bubble.io/t/filtering-option-sets-for-use-in-a-dropdown/122981 "2020-11-26T13:39:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dylanmartens](https://avatars.discourse-cdn.com/v4/letter/d/97f17d/32.png) [@dylanmartens](https://forum.bubble.io/u/dylanmartens)\
**Post date:** [November 26, 2020, 1:39pm UTC](https://forum.bubble.io/t/filtering-option-sets-for-use-in-a-dropdown/122981/1 "2020-11-26T13:39:47Z")

</div>

Hi Everyone,

This is probably a very basic question, but I’ve been struggling like crazy to figure it out. In short, when a user creates a new database entry, I’m trying to hide/remove items from an option set that have already been used. I’ve included a bit more info below:

I’ve created an option set called Exchanges with the names of crypto exchanges. When a user adds a new exchange to their profile, they need to select the exchange from a dropdown (which is populated using the Display attribute of the Exchanges option set), and add some other info like user ID, API key and so forth.

By way of an example, let’s say there are 5 exchanges in the option set and the first time a user adds an exchange, they add Kraken to their profile. Subsequently, should they wish to add another exchange, Kraken should not appear in the dropdown list.

I have a data type called Exchanges which stores the info about the exchange that is relevant to the user (Exchange name, API keys, user ID, date created etc). So I need to search the Exchange name text field of the Exchanges data type and ensure that all Exchange names already saved to the database are not included in the dropdown list when adding a new exchange.

I’ve tried using the filtering and minus options based off a search of the database, but I can’t seem to get it right.

Any help would be greatly appreciated.

Thanks,  
Dylan

---

<div class="post-metadata">

**Author:** ![mikeloc](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/mikeloc/32/93001_2.png) [@mikeloc](https://forum.bubble.io/u/mikeloc)\
**Post date:** [November 26, 2020, 2:04pm UTC](https://forum.bubble.io/t/filtering-option-sets-for-use-in-a-dropdown/122981/2 "2020-11-26T14:04:48Z")

</div>

Hi there, @dylanmartens… here is one way to do it that I just tested. Add a field to your `User` data type called `exchanges`, and set that field’s type to a be a list of `Exchanges` (that is, link it to your option set and make it a list). Then, when a user adds an exchange to their profile, make changes to the current user and add the selected exchange to their list. With that setup in place, filtering the dropdown is as simple as this…

 ![exchanges](https://us1.discourse-cdn.com/bubble/original/3X/c/9/c9a9bcfdf414691ac19b274e4c7130e223a0f433.png)

Again, that’s just one way to do it, but it works well, and you won’t need to search through your entire `Exchanges` data type just to render the appropriate options in the dropdown.

Hope this helps.

Best…  
Mike

---

<div class="post-metadata">

**Author:** ![dylanmartens](https://avatars.discourse-cdn.com/v4/letter/d/97f17d/32.png) [@dylanmartens](https://forum.bubble.io/u/dylanmartens)\
**Post date:** [November 26, 2020, 3:04pm UTC](https://forum.bubble.io/t/filtering-option-sets-for-use-in-a-dropdown/122981/3 "2020-11-26T15:04:11Z")

</div>

Legend - thanks so much! Works like a bomb!

---

<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:** [February 4, 2021, 1:39pm UTC](https://forum.bubble.io/t/filtering-option-sets-for-use-in-a-dropdown/122981/4 "2021-02-04T13:39:49Z")

</div>

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