custom Filter widget to reset filter

435
7
01-18-2021 07:44 AM
JohnL
by
New Contributor II

When using Filter widget, the filter will apply to the same data source cross all the pages. for example, in first page, if created first filter to filter a layer (e.g., population, filter by age > 70). If in second page, created second filter with same data source, need to use whole dataset, however only filtered data available, and there is no way to clear the filtering to reset the filter.

Question: is it possible to modify existing Filter Widget  to have rest option? or create a custom widget to reset the filter? Can someone provide sample to show how to create a widget to reset the filter?

7 Replies
BrianKaplan2
Occasional Contributor

If you set up multiple Views of the same data, you could use each View for different filters.  And only the data shown using the same View will be filtered.

0 Kudos
JohnL
by
New Contributor II

Thanks for the reply. I tried your method: created 2 views (view 1, view 2) , every view has its own filter bind to the same data.  However if filter data in view 1, the filtered data still applied  to view 2. I expect to see the filter in view 2 can filter on the whole data (not the filtered data from view 1). 

Please advise.

0 Kudos
BrianKaplan2
Occasional Contributor

Hi John, I just tried it again and it worked for me.  I may not understand your setup.  There are many configuration steps.  In my case, I set up several views in the Data portion of the Experience Builder using the same data.   I then have 3 Cards in a single row.  In each Card, I added different text elements.   Each text element connects to the data and a specific view through dynamic content.   I then set a filter in Card 3 for all the text elements in Card 3 using the same view.  If I use a different view of the data in Card 2, the data doesn't change with the filter.  

I hope the following clarifies what I did.

Here's where I add data and set the view (4th icon down)

BrianKaplan2_0-1611381176969.png

Here's where I'm configuring a text element in the card selecting the data and the selecting a view.  In each case, I would only select one view.

BrianKaplan2_1-1611381239625.png

 

Then in the text element, I would use the red circled dynamic content button to select the data and view and the variable 

BrianKaplan2_2-1611381328155.png

And configuring the content.  If I change the data source of view, I find it best to delete the old value and add a new one.

BrianKaplan2_4-1611381793160.png

 

And here is the configuration I used for the filter selecting the same data and specifying a view.  

BrianKaplan2_3-1611381520786.png

 

I hope this helps.

 

Brian

0 Kudos
WoodsG
by
New Contributor

Hi Brian, 

Will you share this web app? I want to learn how it works

Thanks

0 Kudos
JohnL
by
New Contributor II

Hi Brian,

Looks you only use one Filter Widget. Can you try to use Filter widget in every view and bind to the same data source?  In my testing, if the data filtered in view 1, then in view 2, only filtered data available, not whole data. 

0 Kudos
BrianKaplan2
Occasional Contributor

Here's a screenshot of two filters using two different views of the same data.  In my case, the filters are acting only on the same views used in dynamic text.   The value below the filter is the filter result. 

 

BrianKaplan2_2-1611632978178.png

 

 

 

0 Kudos
RyanBohan
New Contributor III

I am working on a project with different exb pages for neighborhoods. I am trying to get them to all consume the same source layers with filters applied. The views trick above works great for the list widget on each page.

I am running into a problem with a map at the bottom of each page, which I would also like to be filtered by the same filter applied to the list widget. So I cannot use the addition layer views trick.

It seems I would need to create multiple maps so I can apply the same filter to both the list and the map and not run into problems when I which pages.

Is there was a easy way to clear the filter between pages. Then I could consume the same map and layer on each page.