Forum Academy Marketplace Showcase Pricing Features

Populate a drop down with the values of a field that is a list of things

Hi,

Hi folks,

This may have a rather simple solution, but I can’t seem to find it!

In the USER table, I have a field called Direct Reports. This field is defined as a List of USERs.
I have one record for Manager One that shows that she has three direct reports: Grunt 1, Grunt 2 and Grunt 3.

I want to create a drop down with those three values, which are stored in the one field (Direct Reports) in USER.

The best I managed to display is one option in the drop down with all three reports separated by a comma, instead of 3 options. What am I missing? Can Bubble do this? If so, how?

Here’s a link to the page: https://bubble.io/page?type=page&name=test_users&id=bubbling&tab=tabs-1

The top part is used to create reporting relationships and to populate the USER table when clicking the Save button. The bottom part is to see how to create the drop down that I’m trying to create.

Any help will be greatly appreciated!

Alex

First, the dropdown type should be set to User.

If the manager is the current user, for example, then the dropdown’s source would be “current user’s direct reports” with the caption being “current option’s name”

If the manager is being selected from another dropdown or search box, then the source would be “[element] value’s direct reports”

I’m on mobile and can’t check your link, but hopefully this clears something up.


Gaby | Coaching Bubble

Hi Gaby,
Thank you for your response. What you suggested is one of the 4 ways I tried, but it does not seem to work. You can see the results in the first of the 4 drop downs: 6 options (one for each record in USER, and only one populated with 3 reports separated by a comma, instead of 3 options, one for each direct report.

I know that if each report had a record in a separate table, this would be easy to do (and it’s my fall-back scenario. But I’m storing the relationship between manager and direct reports in the same USER record. The field Direct Reports contains a list of Users.

Any other thoughts?

1 Like

The issue is that you’re searching for User A and displaying the results of the direct reports field for that user. You should be searching for the direct reports of User A and showing their names. Subtle difference.

Below is one way to do this:

Bubble won’t let you do email is in and you have to do a filter to get the is in option for unique id, for some reason, which is why I have had to do a filter after the search.

I hope this helps.

Edit: Note that the search is for all users (no constraints), then you can filter as shown above.

1 Like

This does the trick!!!

I’m very very grateful.
Frankly, this approach would have never crossed my mind. This is why I’d love to understand the thought process that led you to this solution. I can’t think that you used for this the trial and error approach I was using –

Alex

You’re welcome. :slight_smile: Not quite trial and error, but as always with Bubble, once you are clear on what you need to achieve, you then need to find a Bubble way to achieve it, and that can sometimes mean going down a few different paths.

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