Can Arcade be used to exclude records from map?

652
5
Jump to solution
05-03-2023 10:28 AM
Labels (1)
MPach
by
Occasional Contributor II

I need to do something that seems really simple. I need to filter out a bunch of records from the Sewer Mains layer based on their facility IDs? I can't use the Filter expression option though because the dataset is too big and basically freezes the software when I attempt to open the data set to add facility IDs to exclude. Is there a way to do this using Arcade? 

The end goal of what I'm after is for the layer to be displayed without the records that I specify in the list. A SQL expression to better understand this would like something like this:

FACILITY NOT IN ('11111', '22222', '33333', '444444')

I don't care if I have to get there in a round about way using Arcade. What I do have going is there are 3 layers of Sewer Mains that have some overlap in the unique Id's and I thought it might be possible to use an intersect or something to filter out records from one layer if something simpler will not work. 

Thanks for any help in advance

Mark 

Tags (3)
1 Solution

Accepted Solutions
jcarlson
MVP Esteemed Contributor

You could manually add the layer to your map's JSON definition with a filter statement on it, then open the map. Using something like the AGOL Assistant to edit the JSON would make it fairly easy.

- Josh Carlson
Kendall County GIS

View solution in original post

0 Kudos
5 Replies
MPach
by
Occasional Contributor II

As usual I was thinking too hard about it instead of looking for a more simple solution, but if anyone knows how to do something like this I'd still be interested. 

 

0 Kudos
MobiusSnake
MVP

Is the exclusion list reasonably static, and can you modify the schema?  If so, you could add a new field named something like "webmap_display" with values 0 (don't show) and 1 (do show).  Calc them all to 1 to start, then flip the bits of those you want to exclude, finally use a webmap filter on this new field.

MPach
by
Occasional Contributor II

Yes, it's static. Not changing at all for this small project. I can't modify the schema for this layer because I don't own it. I could always create a new layer and upload that to our Portal, but I was trying to avoid doing that if possible, although that would be a very quick and easy solution too. 

What you're suggesting is also an excellent idea! If anything at least we'll have a list of ideas for people to look at hear. 

0 Kudos
jcarlson
MVP Esteemed Contributor

You could manually add the layer to your map's JSON definition with a filter statement on it, then open the map. Using something like the AGOL Assistant to edit the JSON would make it fairly easy.

- Josh Carlson
Kendall County GIS
0 Kudos
MPach
by
Occasional Contributor II

Thank you. I don't make enough of these maps to recall things like that. That should do it. Much appreciated!

 

0 Kudos