I have two table widgets. When the user selects a value from Widget 1, it filters "Table A" on the map based on the selected Category. However, when the user selects a value from Widget 2, I want "Table A" to be filtered on the map based on the combined selection from both Widget 1 and Widget 2.
Here's the structure of "Table A":
ObjectID Category Zone
1 | 1 | 1 |
2 | 2 | 1 |
3 | 1 | 2 |
4 | 3 | 2 |
The filtering logic should work as follows:
When the user selects a value from Widget 1, "Table A" should be filtered to show only rows where the Category matches the selected value.
When the user selects a value from Widget 2, "Table A" should be filtered to show only rows where both the Category matches the selected value from Widget 1 and the Zone matches the selected value from Widget 2.
For example:
If the user selects Category 1 from Widget 1, the table should be filtered to show rows with ObjectID 1 and 3.
If the user then selects Zone 1 from Widget 2 (while Category 1 is still selected in Widget 1), the table should be further filtered to show only the row with ObjectID 1.
How can I implement the filtering based on both widgets' selections effectively?
This is a little bit difficult to follow. Some screenshots would help. It's because of the words being used interchangeably - table widgets, select a value from a widget (is this the table widget), filtering the table on the map? It doesn't sound right.
We have set up things like this where you:
I would generally recommend keeping any 'filters' to be obvious to the end user, and try to avoid stacking the workflow. It will be very confusing to them otherwise. That's why the chart infographics, or actual filter widget are good. They stay on screen with a visual representation of what is getting filtered or not.
Hi @Moi_Nccncc ,
Based on my understanding, you can achieve the filtering goal with the following configurations.
1. Under Widget 1's setting panel, add a message action, trigger is the Widget 1's selection change and the action is the framework-filter on the Table A's data source.
2. Under Widget 2's setting panel, add a message action, trigger is the Widget 2's selection change, and the action is the framework-filter on the same data source (Table A's data source)
3. The filters on the same data source is appended, so the widget consuming the data source (in this case is the table A) will reflect the combined effects.
Hi DanJiang.
The table dose not keep the previous applied filter. every time an filter action happened it clear old one and apply the new one. So you click widget 2 it clean widget 1 filter and apply widget 2 filter only.
I am using in my case ArcGIS Portal 10.9.1 not 11.1.
@Moi_Nccncc I have a quick demo app configured with your case https://experience.arcgis.com/experience/9f156b0080bb4f80bb7ccd42cf3656a1/ It works on AGOL, which is the latest version. Could you have a try with a newly version?
I will try, but What I have noticed is the following.
I have 2 layers which I apply 4 filters on them from 4 different widgets.
The first one is a layer from a web map which is added to my map widget . This works fine and all filters applied normally on this layer.
The second layer is normal layer (not from a web map ana not added to my map) and I apply the same filters from same widgets(this is the one which has a problem).
I could use the first one as both have the same source but I did this because I need to get the count when applying a filters which is calling a rest with statistic count, because the this layer has a join with a table the statistic request failed (This an old problem not solved yet). that's why I had to create a sperate layer without Join.
The filter action doesn't differentiate between data source types, whether added in web map or not, it should all work. It is hard to tell what is wrong from the description. My best guess could be the trigger/action connection fields were mismatched. If you wish to provide a sample app, I can help take a look.
I was following the requests going to the server and could see every request going on every action. the filters are correct and no errors for both layers. the only different is layer1 (web layer added to the map) goes with all filters but the second one clears the previous filter and sends only the new one. I will try to get more info if possible why this happening. I will send the request coming for each layer for each widget.
Here is the requests going to the server
When Click on widget 1. 2 requests are going to the server one for layer 1 and second for layer 2 (2 actions applied);
(First request comes from one click on widget 1).
Request 1 to Layer1. 1 filter after click on widget 1 - /arcgis/rest/services/Portal/landmarks_NoCategories/MapServer/0/query?f=json&resultOffset=0&resultRecordCount=50&where=CATEGORY_ID IN (1)&orderByFields=&outFields=*&returnGeometry=false&spatialRel=esriSpatialRelIntersects
Request 1 to Layer2 . filter after click on widget 1 - arcgis/rest/services/Portal/Landmarks_AR/MapServer/0/query?f=json&resultOffset=0&resultRecordCount=50&where=CATEGORY_ID IN (1)&orderByFields=&outFields=*&returnGeometry=false&spatialRel=esriSpatialRelIntersects
(Second request comes from one click on widget 2).
Request 2 to Layer1. filter after click on widget 2 - (First filter was cleared and second filter only applied).
/arcgis/rest/services/Portal/landmarks_NoCategories/MapServer/0/query?f=json&resultOffset=0&resultRecordCount=50&where=SUBCATEGORY_ID IN (600)&orderByFields=&outFields=*&returnGeometry=false&spatialRel=esriSpatialRelIntersects
Request 2 to Layer2. filter after click on widget 2 - (2 filters applied first and second as excpected).
arcgis/rest/services/Portal/Landmarks_AR/MapServer/0/query?f=json&resultOffset=0&resultRecordCount=50&where=SUBCATEGORY_ID IN (600) AND CATEGORY_ID IN (1)&orderByFields=&outFields=*&returnGeometry=false&spatialRel=esriSpatialRelIntersects
@Moi_Nccncc I did a test on the single layer case and updated the above sample app (see page two). It works as expected, that the requests are the combined filters. I could not tell why the filter is replaced with the latest one in your case. Maybe contact a support engineer will better help position the reason.