Select to view content in your preferred language

custom Filter widget to reset filter

5518
17
01-18-2021 07:44 AM
Labels (1)
JianT
by
Occasional Contributor

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?

17 Replies
by Anonymous User
Not applicable

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
JianT
by
Occasional Contributor

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
by Anonymous User
Not applicable

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
JianT
by
Occasional Contributor

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
by Anonymous User
Not applicable

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
Frequent Contributor

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.

TonghuiMing
Esri Regular Contributor

Hi @RyanBohan - Map in ExB utilize special view(s) which is not affected by any views other than the default view. See the first Note in Use data in Document: Select data > Use data:

When displaying a web map or web scene in a Map widget, a new web map or web scene view is created automatically, and this view is only used in the current widget. Thus, data processing within the Map widget won't affect widgets using the same data source or its contained layers. But the Map is affected by data processing on the default view.

 

Unfortunately, there is no easy way to achieve your goal, other than the methods you mentioned above (adding multiple Map widgets). Hope it helps for your reference.

 

Best,

Tonghui

RyanBohan
Frequent Contributor

Hello Thonghui,

Thank you for the reply.  I am correct that not only would I need multiple map widgets.  I would have to duplicate the map itself? 

On the application we are building out.  I could see using the same source data on 10 different pages.  With out a way to automatically clear the filter between pages, it would be duplicating the source map 10 times.  Which would make something simple like updating the pop-up, a rather long process because it would need to be done on each map. 

If I could add something to the filter widget to clear previous filters this would not be necessary.

0 Kudos