Repeating group data source synced with URL parameter (location/text)

Hello everyone,

I’m trying to figure out the best practice for this solution. I’m building a platform similar to Upwork, where users can filter based on different criteria such as location, experience, etc. Users can also save their filters using a data type called saved filters so they can quickly switch between different views. I also need the URL to reflect these filters, so if someone copies and shares the link, the recipient will see the exact same filters applied.

For simple things like years of experience, I understand how to handle that part. But when it comes to addresses/locations, things get more complicated, and I’m struggling to fully understand why.

Here’s my current plan: I’ll have a filtering menu on the left side (like the one below). Instead of updating results immediately whenever someone changes a filter, I’ll have a “Save changes” button. My assumption is that this approach saves more WUs than updating in real-time, but please correct me if I’m wrong.

Now, here’s where I’m stuck: let’s say I have an input field with the address content format. When a user types in an address, Google API suggests the correct one (e.g., “Stockholm, Sweden”). Then they click “Add,” and it gets stored in a repeating group (I’m thinking this would be stored as states?). The tricky part is that these states need to stay in sync with the URL parameters and vice versa. For example, if someone pastes the link, the filters should be pre-filled visibly so they can edit them if needed.

Does anyone have an example of this setup they could share, so I can have a look at the editor maybe? or maybe just guide me on how to do it? Biggest issue is the address because i cant really split by “,” etc for the repeating group.

I know you @msgiblin have a pretty nice filtering feature for his project that i have taken a look at many times KnowThyDrink - Search Cocktails https://www.knowthydrink.com/search?name=&liquor=Bitters&min=90&max=395&characteristics=Boozy_Floral_Light&allergens=Eggs_Peanuts_Sesame&mybar=No

Thank you so much in advanced :pray:

You don’t need custom states at all if using url parameters.

Make sure url parameters are of correct data type, so ensure you extract address from url parameter and set type of data to address.

For examples search forum with my handle and keywords of url parameters, probably enough posts to get enough examples to understand it all.

1 Like

Okey thanks @boston85719! Question, how do i add these to my filter then without doing a lot of unnecessary WUs?

Your filter values are the url parameter values. If you want to not consume WUs there is a lot more to do, but to fix your issue, ignore WUs as it is not much anyway for filters unless your filter values are all data types.

Okey, but how to i “save” one new adress to the filter, on the button workflow is it a “go to page” and then send new parameters and include old ones or how would i do this?

@boston85719 Also not sure how to fetch the data here to display the data from the URL parameter? It’s asking for “more…”

Your data source will need to be a list of things. The Get Data From URL would then be used as a constraint on top of the search.

Assuming your repeating group is indeed supposed to show a list of schools, you would set the data source to: Do a search for Schools. On that search, add your constraints, each referencing the correct URL parameter. For example, if you had a URL Parameter for ‘level’ (associates, masters, etc), and a ‘level’ on the school datatype, you would add a constraint:

Level = (or Contains) → Get Data From URL (parameter: level)

1 Like

That is a list as a parameter. There are a few posts about how to do that

1 Like

Thank you @msgiblin and @boston85719 :grinning_face_with_smiling_eyes: :pray:

1 Like

@msgiblin @boston85719 What about geographic address to get data from page parameter? I have tried looking around but can’t find a good way to do it or maybe im missing something?

For example (my understanding with chatgpt is that location is not a list, so i was thinking and trying maybe split by “,” but then i get Stockholm Sweden for example instead of Stockholm, Sweden:

What i did to make it work (not sure if it’s correct but it works perfectly with the map and everything)

  1. Use a search box (choices style geographical places)
  2. A button to “Add location” → Workflow that add’s search box value to a state list of geographical places (if you dont want to overwrite the old locations remember to add the old states :plus item) and then displaying it in a repeating group with data source state name's geographical places
  3. A “Apply filters” button (just becouse i have more filters and want to save on WUs) → Workflow that goes to page and sends page parameters where the value is repeating groups list of geographical places :join with “|”, note this is not an “i” or “L” it is a vertical bar (on mac option+7)
  4. To test i just put a map element with data source get data from page parameter :split by “|”
  5. And viola, your places will be visible on the map :slight_smile:

Again, not sure if this is the best of correct way to do it so please @msgiblin @boston85719 correct me if this is a stupid way of approaching this so not more people follow my example :pray:

As long as your map data source is indeed able to be a list, and it’s working, I’d say this is a good solution, with 1 exception- the “|” symbol isn’t considered URL safe as different browsers may encode it differently - you could use an underscore or “_” or hyphen “-” provided you aren’t already using those in the location names. Great work!

1 Like

Oh i had no idea aout the “|”, thanks a lot i will change that :pray:

1 Like

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