WHY such a simple query expression is still impossible in bubble?

i have a list of employees, and a list of branches, all employees are connected to a single branch.

I have a repeating group which i want to show only employees who’s branch’s “East Coast?” is “Yes”

There could be NO branches in the East Coast, or MULTIPLE branches in the East Coast at a given time.

Now, usually in such a case, you can start the search from the bottom up:

“Search for branches, constraint by “east coast?” is “yes”, 's employees”.

But i keep bumping into alot of cases where you can’t start from the bottom up for variable reasons.

So the usual way is to write the following:

"Search for employees constraint by branch = “Search for Branches constraint by “east coast?” is “yes”, first item”

The results in this case will be WRONG for 2 reasons:

  1. since it could be MULTIPLE branches in the East Coast, “First item” will imply that only employees connected to branch 1 in the east coast is qualified, but what i want in this case is to show all employees who’s connected to ANY of the branches in the East Coast.

  2. Since it could be NON branches in the East Coast, “First item” will return no value which in turn will mean no constraint, and the RG will show ALL Employees!, but what i want in this case is to show an EMPTY RG.

I keep coming back to this problem again and again, and i keep wondering how i’m the only one struggling with such a simple query.

Fixing this would really make life much easier, i hope bubble will take notice.

Thanks

Don’t use the equal comparison operator. Use the “is in”. It is meant to be used on lists. So "Search for employees constraint by branch IS IN “Search for Branches constraint by “east coast?” is “yes”

1 Like

Are you not able to do search for employees, constraint by branch is in search for branches constraint by East Coast = yes?

1 Like

Ok, so this solves problem #1, what about when there is NON in the east coast, the branch search will return no list, which will imply to show only Employees who’s branch “is in” an empty list.

What will be the result? an Empty RG, or an RG showing all Employees without any constraint?

It likely will show all entries, as this is a known ‘issue’ (or rather feature) with Bubble. You should be able to get around it by adding an additional constraint “East Coast isn’t empty” (assuming “East Coast” is a field).

I don’t think that is true if @cheskiefisch set his East Code field up the way he indicated he did. He said

I have a repeating group which i want to show only employees who’s branch’s “East Coast?” is “Yes”

That indicates the East Coast is a “Yes/No” field. In Bubble Empty evaluates to “No” for Yes/No fields. I think he would have that problem if East Coast was a text field, but not a Yes/No.

it would be the same problem with yes/no field, since the branch search will return no list because there is no branch with “east coast” as “yes”.

i’m trying to understand what you mean? where is this constraint written and how exactly?

@louisadekoya
@mguerrasio

Why isnt this possible when the branch field is a “list field”, for example when an Employee can be connected to Multiple branches,

and i want to show only employees who’s

  1. ONE OF its contained branch’s “East Coast?” is “Yes”.

Or

  1. ALL of its contained branch’s “East Coast?” is “Yes”.

OR

  1. All of its contained branches matches the list of another

OR

  1. Its contained branches intersects with another list

Are any of those queries possible?

i have alot of times where i cant start from bottom up because of variable reasons

Ah, my fault. I read it wrong.

thanks for trying anyway, can you answer on the question i asked later:

Yes, these should all be possible. I’ve done the first two here - https://bubble.io/page?type=page&name=branch&id=louisforum&tab=tabs-1

For the third you should be able to use the contains operator so list 1 contains list 2. The last seems like a variation of the first two, but using two employee lists (and the intersects operator).

These may not be the most efficient searches, I just wanted to show what’s possible.

2 Likes

The intersects method that @louisadekoya has done above solve these I think.

You can do none (count <=0) one (count = 1) many (>1) or all

Sorting it is another matter.

2 Likes

@louisadekoya
@mguerrasio
@NigelG

i came up with a simple solution to solve the above issue (Problem #2), tell me if i’m right.

Instead of using the “=” or “is in”, use the opposite like “isn’t in”, this way whenever the related list returns empty you got nothing to lose.

To use example above: if i write: Show only those Employees who’s branch “isn’t in” list of “East Coast?” is “no”, and there is no branch with “East Coast” as “No”, the result will be that the RG will show all Employees without any “East Coast” constraint, and you shouldn’t care because there’s anyway NO employee with “east coast” branch as “no”, because there is no such a branch!.

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