Repeating Group filtered according to URL parameters with advanced filters

Hello all,

I want to filter a Repeating Group (RG) according to URL parameters.

I have followed this solution from @sharma.himanshu0608 (thank you for the article :pray: )

For this Topic, I will use only 2 input elements but my goal is to replicate it with tens of input elements.
Here are the 2 input elements:

  • Note A is a Dropdown
  • Type is a Multi dropdown

With a Dropdown, it is working almost perfectly.
When I click on the Search button (“Rechercher” in my case), the RG is filtered according to URL parameter.

Here is the :filtered expression of the RG (only the second constraint is applied in this case):

When I copy paste the URL in a new tab, the RG in the new tab is correctly filtered according to the URL parameter.

I said “With a Dropdown, it is working almost perfectly” because I would like to find a way to have the Dropdown already set up on the value of the URL parameter.
Example :
I select 4 for Note A :

I click on button Rechercher, the URL is updated with the Note A and the RG is filtered according to the URL :
image

If I copy paste this URL in a new tab, the filter Note A is correctly taken into account in the RG but the “4” is not selected in the Dropdown Note A.

image

If you have any suggestion for this, I’d really appreciate.


Where I have more difficulty is for Multi dropdown.

If I select several values in Type for example, then I click on button Rechercher, the RG is correctly filtered.
As it is a Multi dropdown, the only solution I found to filter the RG was to create a custom state (type).
Here is the workflow:

Here is the :filtered expression of the RG:

The issue I have is that when I copy paste the URL in a new tab, the RG is not filtered correctly. This is because the RG Advanced filter is based on the custom state that is triggered when button Rechercher is clicked.
I have tried to set state of custom state type of Multi dropdown Type when page is loaded by getting the type from page URL and :converted to list

It is working when only one value is selected in Multi dropdown Type but not working when several values are selected in Multi dropdown Type
Example : if I select Légume in Multi dropdown Type, then I click on Rechercher, then I copy paste the URL to a new tab, I see in the debug mode that when page is loaded, the state type of Multi dropdown Type is correctly got from the URL

However, if I select Légume and Fruit in Multi dropdown Type, then I click on Rechercher, then I copy paste the URL in a new tab but in the debug mode I see that when page is loaded, the state type of Multi dropdown Type is empty

In the URL of this page there are those parameter : &type=Légume%2C%20Fruit

Also, the issue with this workflow is that when I select several values for Multi dropdown, then I click on button Rechercher, then the page is loaded but :converted to list remains empty (even without copy paste the URL in a new tab).

Could you please help me to find a solution?
Maybe the direction I took is not the right one to answer my primary need which is to filter a RG according to URL parameters with advanced filters.

Any help would be really appreciated :pray:

Thanks!

hey @mossoc99 this can be done. I don’t have access to my laptop right now but I’ll share a demo tonight

1 Like

Hey @sharma.himanshu0608, thank you!
For information, I have found the following solution inspired by this post.

In the screenshots below I have changed the names of the fields compared to my original post but the context and the need is the same: I want to filter a RG according to URL parameters and filters are classic dropdown and multi dropdown. In the example below, I filter a list of plants according to the growth (slow, medium, fast).

Here is the page editor:

Here are my workflows:

Here is the expression of the Repeating Group:

This solution seems to work well. However, if you have any other way to do it that according to your experience is more efficient or relevant (especially in relation to app optimization and workload), please do not hesitate, I am opened to any suggestion!

With this solution I described, I just have one remaining issue:

I select values (e.g. Slow and Medium) in the multidrop down:

I click on Search.

The URL of the new page is correct and the RG is correctly filtered:
image

I copy paste the URL in a new tab. The RG is correctly filtered but the values in the multidrop down are not selected:
image

Any help on this would be really appreciated :slight_smile:

That is because you didn’t set the initial value of the multidropdown to equal the URL values

1 Like

Oh yes that makes completely sense, thank you very much @boston85719 :pray:

For Default value, the only accepted expression that makes sense to me is this one:

As it has to be a list of growths and cannot be a text.

But this does not work in Preview mode: if there is values for URL parameter growth, there are still not the corresponding value selected by default in the multi dropdown growth. Do you have any suggestion?

Yes, make the default value a search and have constraints use the URL data

1 Like

Awesome it is working, thank you very much @boston85719 :pray:

1 Like

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