Returning a List of Things Based on Radius to Zip Code

Hi -

I have a list of Things that have a geographic address. I am trying to configure a Repeating Group to display only the Things that have an Address within 50 miles of a Zip Code entered into an Input Field. I have installed the ZipCodeApi plugin and am using that to convert the Zip code entered into the Input Field into a location.

I am not able to get this to work and it seems I am very close but missing something crucial. Any help or ideas would be very much appreciated!

image

Hey @jdg257

  1. Did you setup your Google API keys in Settings > General?
  2. Did you try the ZipCodeAPI independently from the search? i.e. does it convert to a location?

Ambroise

Need help building your app?

Book a free 15 minutes call - happy to help if I can

Hi @ambroisedlg! Thank you for the response. I did setup my Google API Keys and verified the ZipCodeApi is working. I added some text fields near the search bar that show the location data on the Zip Code that is input in the box. You can see that the location is converting correctly but the search results are not being filtered.

@jdg257 alright, have you tried storing the input’s value into a custom state, then using that custom state in your RG search constraint (instead of Zip Code API)?
Sometimes that does the trick

Ambroise

Need extra help?

Book a free 15 minutes call - happy to help if I can

Ok, I am new to Bubble so bear with me. I read through some documentation on custom states and am not sure I fully understand.

I set the custom state in the Workflow for the Search Button. Now I assume I need to reference this custom state in the RG constraint? I can’t find anywhere in the constraint menu to refer to the custom state I created?

@jdg257 that should be correctly setup

Now in your Search for Courses, replace your constraint by Full Address is within 50 miles of Input 15219’s zip_state

Let me know if that helps

Need extra help?

Book a free 15 minutes call - happy to help if I can

Ahh there it is! This now works. Thank you so much! I will mark as solution.

1 Like

Glad I could be of help @jdg257!

Need extra help?

Book a free 15 minutes call - happy to help if I can

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