Select to view content in your preferred language

Filter Widget working opposite

461
5
11-30-2023 09:01 AM
Labels (1)
djariwala
New Contributor

Hi,

I have created a floor plan with a rest service in Portal Experience Builder. The portal version is 10.9.1. The rest service has 3 group layers for each floor. Each group layer consists of other feature layers such as printers, floor spaces, locked spaces. The rest service was later used to create a Web Map. The "locked spaces" feature layer has a field called "locked space" and it has two attributes/values, "Active shooter" and "Locked for Technology". 

My main goal here is to display "active shooter" and "Locked for technology" with toggle option. The idea is to show the regular floor plan with all other features, and I want to display "Active shooter" and "Locked for technology" on top of regular floor plan but with the toggle option. 

To achieve that, I used 2 separate filter widgets for each attribute (active shooter and locked for technology) as you can see in below picture.

Screenshot 2023-11-30 104952.png

For filter, I didn't create any data view, but I used SQL query for each filter accordingly. Now the issue is filter widget is behaving opposite to what it should do. When both toggles are off, both attributes (active shooter and locked space for technology) are being displayed. And when both filters are on, they disappear. See below picture. Screenshot 2023-11-30 105503.png

I am not sure what I am doing wrong here. Any insights will be appreciated. 

 

Thanks. 

0 Kudos
5 Replies
JeffreyThompson2
MVP Regular Contributor

Every option in the SQL builder has a negative equivalent, so if you aren't getting what you want from 'is' try 'is not'.

JeffreyThompson2_0-1701367639658.png

You could also use the turn on automatically option to reverse the feel of the filter.

JeffreyThompson2_1-1701367750861.png

 

GIS Developer
City of Arlington, Texas
0 Kudos
djariwala
New Contributor

@JeffreyThompson2 Thanks for chiming in. I have already tried the "is not" route but it's not affective since the "Locked Spaces" field has only 2 attributes (Active shooter and locked for technology). If I use lockedspace is not Active shooter in SQL builder, the other attribute "Locked for technology" attribute will get selected. And the same goes for 2nd filter. 

The option for "apply filter automatically" doesn't help either. 

0 Kudos
JeffreyThompson2
MVP Regular Contributor

Ok, I think I figured out the problem. Because you are using two separate filter widgets on the same data, they are fighting each other. Try putting filters in the same Filter Widget and using the OR connector.

JeffreyThompson2_0-1701371677850.png

 

GIS Developer
City of Arlington, Texas
0 Kudos
djariwala
New Contributor

Like you suggested, I tried filters using "OR" but it still behaves the same way. Anyway, I kinda got what I wanted but it's not ideal. 

djariwala_0-1701701683352.png

So, the issue I am facing is, in experience builder you can't just turn off the feature layer and then use it again for filter widget. Over here, the feature layer for Locked spaces is "on" before applying any filters. If I keep it "on", I'll face the problem like I mentioned in my initial post. For solution, I added one more filter called "Turn off" which turns off the "locked space" feature layer visibly. See below. 

djariwala_1-1701701966847.png

Now If I apply both other filters, it works like I wanted it to, but this solution is not ideal.

djariwala_2-1701702051721.png

I wanted something like picture 2 ideally but without "Turn off" filter. 

 

 

0 Kudos
JeffreyThompson2
MVP Regular Contributor

You might get better results if you can reorganize your data so that 'active shooter' and 'locked for technology' are in two separate columns.

GIS Developer
City of Arlington, Texas
0 Kudos