Forum Academy Marketplace Showcase Pricing Features

Repeating group: How to only show elements that are a certain distance from the user

Hi, I have a repeating group with a bunch of dishes (The repeating group’s type of content is set as ‘Dishes’), each dish also contains another data type ‘restaurants’ which has an address associated with it. I’m trying to create a condition saying that when the user selects a limited distance such as 2 miles, only elements within that radius will show.

Currently, I can’t find any option related to the dish’s location, and I wonder if that’s because the ‘Type of content’ of my repeating group is ‘Dishes’ and therefore doesn’t allow me to create conditions based on fields within ‘Restaurants’ even though they’re related.

Any idea on how I can filter this?

Thank you in advance for your help :slight_smile:

Here’s what I used for a job board in my app:

As well as having a location box that user’s could type in a location, I also have a dropdown box where they can select how many miles away they want to search (I’ve done increments of 5 miles up to 80 miles away).

In the pic above it’s the “Location is within…” condition which is doing the filtering by distance.

Hope that helps!

Dan

Hi Dan, thank you so much for your help! My problem is that when adding a new constraint, I can’t select the ‘Location is within’ command - the geographic parameters are part of another data type (Restaurant) which even though is associated with my Data Source, isn’t something I can create constraints on through Bubble. Do you have any idea how to go around this?