How to save a list of url parameters in your database that are based on an option set

Hi all.
Thanks to @boston85719 :innocent: I now understand how to set parameters as a list, and search using them. Next question is how do you save a list of parameters to a database when you don’t use custom states?

Thanks in advance!

1 Like

Screen Shot 2021-03-26 at 4.30.15 PM Screen Shot 2021-03-26 at 4.29.59 PM

Thanks @boston85719. I should have clarified my question further. I’ll give you an example… let’s say I have this simple form:

Let’s say I want to use option sets to display where you’ll find me on social media and I want to be able to choose multiple options in that list. Let’s say I also want to be able to save that list to the DB. And for this example we’ll say I am saving the URL into DB too.

If I use a combo of custom states and parameters everything works:

Is there a way to save the choices made from the list based on the option set list into the DB without needing custom states? I mostly am trying to understand how far you can push the URL parameters abilities when dealing with lists.

Also a giant thanks in advance for your feedback. I’ve learned a lot reading your posts! :smile:

Yes, you would need to extract the values from the parameter as a list using the regex pattern the same way it is done for setting up the filters to be recognized

Screen Shot 2021-03-26 at 11.16.09 PM

The screen shot shows a dynamic expression that is set up to determine if a particular entry in a RG of the type option set is in the list that is a URL parameter…Just remove the ‘contains’ portion and you have a list of texts that would be the display of Option sets…then you would just run a function to get the list of option sets whose display value is in the list of texts

Sorry @boston85719 - I am clearly missing something! :no_mouth: Assuming the next part of the expression below is correct what am I still missing? I have fiddled with tons of combos to try to accomplish “then you would just run a function to get the list of option sets whose display value is in the list of texts” but gotten nowhere … and again I really appreciate the help!

The expression is a list of texts

So you will need to run a workflow or set something up to take that list of texts and turn it into a list of option sets.

Taking a step back, what are the various use cases for this approach?

no need for customs states for filtering which get lost when a user navigates or refreshes a page, so a user can navigate away from the search page and back to it and still have their search filters set for them just like you would on any large Ecommerce site

Having the ability to save a URL as a single text field for a user to save their search…Lots of reasons why that would be beneficial such as sharing the search results with somebody else by sharing the URL, or for wholesaling platforms where the user who is a purchasing department manager is searching for the same types of products (ie: using same filters) every week and may want to save a lot of different types of searches

Ah, got it, thanks for the explanation.

Ok so here is the answer I built:

You take the entire option set list - in this case “All Platforms” and filter (in this case “filtered”) it by "the list of text (“get selection from page URL: extract with Regex”) where the list of text matches what’s in the option sets list of text. To do this bit used an attribute which was also in lowercase (in this case the "filter). So we get "contains list This Platform:converted to a list’s filter.

Thanks again @boston85719 and @ed727 for contributing to the conversation. It’s interesting how little you have to write using the URL parameter list method.

1 Like

Nicely done…using this method could allow for some interesting use cases in regards to saving data on users searches to gain greater insight into their behaviors so as to take that collected data and utilize it in algorithms to serve them up content that is relevant to their interests.

Being able to extract and save the list of options into a data type field that just is a data aggregation to get a sense of the most popular ‘filter options’ or something of the like to get at some good user insight.

1 Like

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