[RESOLVED] Help needed with a RG Search criteria

I have a RG that searches for all Notifications that meets the following pseudo criteria

IF
Notification Address is within 15 kms
OF
Vault 1…4 managed (associated to) by Current User’S Address
AND
Type is Task Broadcast
THEN
Display Notification’s Body text

The issue here is that even when a User has no (zero) Vaults associated the Notification is still being displayed.

why is that? and how can I get around this?

To further explain the issue…

For debugging purposes I am displaying the count of the number of Vaults associated to Current User

as you can see the count is zero

Could you set a condition on the notification box to say “if current users vaults associated = 0” this is not visible??

The other thing: I have had a relatively similar scenario… double check that there is no contradiction in the syntax.
If somewhere along the line, the current user can be associated closely enough to the notifications criteria - that could be triggering it.
I’ve personally noticed in my app as well that it becomes more difficult to get things “air tight” as the complexity increases.

You obviously have a great understanding of bubble and your specifc app though.

I don’t know the answer to this issue - but those are my thoughts anyway.

Cheers

So by design we ignore constraints when the value that is used in the constraint doesn’t exist (the reason being, for instance, if you some search criteria the user can set you usually want to ignore them if the user hasn’t set them, like a price limit). But it’s not always perfect…

So, in your case, a way to solve this would indeed be to have a condition on the repeating group that checks if the vault field is empty or not, and then define a different data source when the rep group is in this condition.

1 Like

thanks @jordanfaucet for your ideas…

thanks @emmanuel this has worked.

To assist others with a similar issue…I added a condition that checks the count, if this = 0, I then specified the search criteria to use.

3 Likes

@emmanuel

so it turns out that when I change the Kms value to search ‘address is within’ to something as low as 0 or 1 kms the constrains appear to be ignored.

I have 4 merged Searches which relates to the limit we have put on Vaults that can be associated to a User.

In the case above this user only has 2 Vaults associated, so in theory it should compare against item 0 and 1 of the Vault list and ignore the others.

I know that the Notification address is not 1kms away to any of the Vaults so it should not pick the Notification for display.

any ideas?

If it’s zero the comstraint is ignored I think, for 1 it shouldn’t. Have you tried debugging it displaying somewhere in your app the actual distance?

Bubble has come a long way since I tried to solve this, but the way I ended up doing this multiple location search was to have each “location” as a summary for the local area.

It wasn’t perfect, but each location (when created) also had reference to other nearby categories of location. So I only had to find the nearest, and then read the list on there.

It was (as you have seen :slight_smile: ) pretty tortuous to do, but by doing it in advance it did mean I was able to debug in advance, rather than rely on a complex search on the fly.

And in the end I gave up and re-wrote my app to work in a different way. Basically people would “check in” with interesting things (and a category) in locations, and I could then pull back the top categories in your location. This was a similar search (find multiple nearby locations and sort them).

Sorry, not much help, but I feel your pain.

thanks for your input @NigelG
:slight_smile:
Because of this limitation in Bubble, I placed a limit on the list (Vaults) that a user can have. Therefore I was able to reference ‘item#’ to check against.

@emmanuel

as suggested, for debugging I am displaying the distance between the Notification Address and all the 4 Vaults that is associated with the user by referencing the “item#” on the List search.

The issue is that when I do a search and specify a ‘search within’ distance of just 1 kms of any of the Vaults, it should not pick up the Notification listed below as this is at least 4.3 Kms of any of the Vaults (which there are only 2)

any ideas?

Here is the output:

further to this…

I’ve removed the un-necessary searches underlined in red below that relate to non-existent Vaults and surprise surprise, the search has worked.

So, this has confirmed that searching for an specific non-existent item in a List is simply ignored by Bubble.

is there a work around @emmanuel by any chance?

I managed to do this the long way and create multiple conditional searches.

1 Like