Forum Academy Marketplace Showcase Pricing Features

Filtering a list by a specific value

I am a bit confused on how you can populate a list that is filtered on a specific value that I as the “programmer” has specified.

Here’s the case. I have an Organization that has Users, and those users have a Gender (male or female). Gender is a Data Type.

I want to show a text field that calculates the number of Users that belong to the Gender named “Female”, but I can’t for the life of me figure out where I can specify this particular description. The calculation is working, as when I choose to search for the first item or last item, it returns the correct count. However, that seems like a poor solution, as it would screw up if I added one more gender.

How can I filter it to search only for Employees ––> Gender ––> is “Female”?

In this example, you can just use “Gender = Female” Bubble lets you type plain text in those fields, so as long as your capitalization/spelling is consistent, it’ll work fine.

Logically, what you are trying to ask Bubble is this: Show me every user who is a part of the parent group’s organization, and is a female. In your screenshot above, you are actually asking this: Show me every user is part of the parent group’s organization, and has a gender of whatever is the last entry in my database.

Hi!

Thank you for the quick reply! I’m still not able to actually type in “Female” in the Constraint. I can only choose Click and make my choice from the dropdown list.

Sorry if I am acting completely noobish now :slight_smile:

Not noobish at all. Its frustrating at first just start force typing “Female” . Why don’t you do a drop down with (Male, Female,… then just reference the dropdown gender value on this field. This allows for more flexibility

That’s strange. Maybe delete that row on the “Search for Users” panel, then add it again. Then, right after the equals, try to type Female. Sometimes in Bubble, I find that it doesn’t like it when I try to remove dynamic expression and replace it with a hand-typed string, so I end up removing that entry and just doing it again from scratch. It’s only about 15 seconds lost, no biggie in my case.

Thank you both for the input. It simply will not allow me typing in anything for Gender in particular. I even tried in a different browser. However, for any field other than Gender, it’s no problem. (As you can see, I can search for a first name just fine).

Does that bring us any closer to the solution? I appreciate the help, thank you guys!

Taking the liberty to bump this.

Does anyone know?

Assuming you are clicking the [click] and then get …

And you are are trying to type in [Search…]

Which part isn’t working ? Clicking on Click … or Typing in Search ?

I am trying to type in “Female”, as that is the string I want to constrain the User search by.

Yes, I can click the Click. Is that what I am doing wrong? Should I filter the “Female” search through another “Do a search for”?

Click [click] and the input should change to [Search…]. Then start typing …

So you get the drop down when you click [click] ? It should always have Current User on the top etc.

FYI there is a political movement here to officially have 33 genders, will make for some interesting database and app changes if it goes ahead.

After the Gender Recognition Act in the UK, it now possible for a Person to legally have two Genders at the same time, another great conversation with the DBA. Although “What do you mean year is more than two digits !” was also a highlight.

The system is actually prepared to handle more than two genders, as genders is a data type :slight_smile: The dashboard would have to change a bit though, and it might be difficult to find a fitting icon for all 33 of them.

Two genders at the same time we would also be able to handle by converting to a list. Bubble might have taken the complexity out of programming – but not out of public policy it would seem. Still, if it makes people happy, I’m all for it :yum:

I can type “Female” after clicking Click (and seeing the menu), but it will not accept the term, and reverts back to the red Click as soon as the field loses focus. Pressing enter does nothing.

Sorry, ignore everything I have said previously ! My fault for not reading back to the beginning.

You can’t type “Female” in there, because it is not a text it is another datatype. So you will need to do search within the search.

You have to put “first item” in there, but that is fine … as long as you only have a single entry for “Female” on your gender table.

So in your case. Search for users : count > Gender = Search for Genders > xxxx = Female

However that is a pain, as every time you add a new Gender, you have to rebuild the page.

So I think what you want to do is have a Repeating Group that Searches for Gender.

Then in each cell, Search for users with that Gender (which is a straight equals, no Search needed) and do a :count.

That way you can add as many as you like and it will still count the users with that Gender.

Thanks for updating! Solving it through a Repeating Group absolutely seems like a good solution. I will try that!

(yes, I’ll admit I’m slightly embarrassed to not think of that myself)