Forum Academy Marketplace Showcase Pricing Features

Show Addresses "X" distance from current users Address

Hi All,

I posted yesterday regarding same problem, No response so I thought I would try explain the problem I’m experiencing more clearly.

I have a test app whereby I am testing showing “contractors” who are within a certain distance from the current user’s address in a repeating group. It is part of a bigger project however I created the test app to try and isolate and troubleshoot this problem.

both “User” and “contractor” data types have a geo address field (Bubble resolves addresses quite nicely here) and the contractor has a number field “willing_distance” basically the distance he is willing to travel to potential clients

This works seamlessly when I use a static parameter for the distance and not the willing_distance field as shown below:

However, my plan is to allow a “contractor” to stipulate their own “willing_distance”. “willing_distance” is a number field so in theory all I need to do is change the expression to dynamically use that number field and it should work the same as when using a static number. Unfortunately, I’m on day 4 now and I have found no solution. It just doesn’t work. the expression looks like this:

I am not sure if this is a bug and I need to report it or if I’m doing something wrong. In my opinion, as the willing_distance field is a number field it should treat it exactly the same as when I stipulate a static number? My only other thought is that there is some formatting of the number going on in the background? Any help is greatly appreciated this is hurting my brain.

Editor to the test app:

No one ? :sob:

Hi there, @rosewaterbrands… the number field is fine… I believe it is the reference to the parent group’s contractor that is causing the issue.

I think the way you need to go here is to use an advanced filter, and I set up a repeating group in your test project that I believe produces the desired results. Check it out and see if it looks right to you.

As you probably know, using an advanced filter could hinder performance because the system will return all of the contractors to the browser and then do the filtering on the client side. That being said, I can’t think of another way to go right now, but I might be able to put some more thought into it later.

Hope this helps.

Best…
Mike

Hi Mike,

That logic makes sense and your fix is doing exactly what I want it to. I am concerned with the performance issues when using the Advanced function however this fix at least allows me to continue development, I will run a few tests to see the impact on performance when a few 100 contractors are loaded and need to be filtered.

Thanks a million for your assistance. Appreciated.

1 Like