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 )
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 :
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.
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
Thanks!