Hello I am super new to ArcGIS & Arcade, and I am hoping my ask is pretty simple... I just don't know what I am looking for to search.
I have a list of zipcodes in the united states, and I was wondering if I can use the 'New Expression' to filter a number of zipcodes so that my graph will only show those? Sometimes the number will range from 50 zipcodes to 1,000.
Is this possible and can the code as simple as: $feature["ZIP_CODE"] equals(10001, 10002)?
Solved! Go to Solution.
If you have an explicit list of zip codes, the SQL version of that would be zipcode IN ('10001', '10002', '10004'...) but you don't have access to writing that filter in the web map. You could write it in Pro, or else modify the map's JSON using AGOL Assistant to paste the SQL in directly.
If that's too advanced, you can just keep modifying the existing filters. Try adding sets to the filter, so that you can combine "starts with 10" and "does not equal 10003" into a single condition.
Unfortunately, if you need a specific filter, you're going to need to do a lot of clicking. But there's really nothing stopping you from accomplishing this in the map.
Can you give some more information about where you're using this expression? Is it in a popup? A Dashboard?
Filtering your data to include multiple specific values is possible, but it's usually done outside of Arcade (though it is possible for an expression to do this, too).
Hi! thanks for reaching out. I am using a dashboard. My layer is all of the united states zipcodes. So for example, I only want to highlight around 2,000 specific zipcodes in New York.
After some research I saw I might have to create my file of those 2,000 zipcodes into a layer itself & combine the two.... I think I would rather hard code compared to that though because I am not having much luck that way either.
At the map level, you can apply a Filter.
From there, you can build an expression like this:
That way, the data is already filtered when the map loads in your Dashboard.
You can apply the same kind of filter in the Dashboard itself, but on a per-widget basis. Probably best to do it in the map.
Thank you for the photos, super helpful. What if I only want to show a specific portion of NY?
Play around with the filters and see! You should be able to get pretty close with some broad "begins with" filters, then some more specific ones to get anything else.
For instance, "starts with 10 Or starts with 11" gets you Manhattan and the southern end of the state. If you need more beyond that, you can just add more specific statements to the filter to get them.
Thank you so much for your help, although I would like a more specific way. I have ~2,000 unique zipcodes and it would be too much to play around with.
For example I might want to highlight zipcodes 10001,10002,10004...10013 but not 10003
If you have an explicit list of zip codes, the SQL version of that would be zipcode IN ('10001', '10002', '10004'...) but you don't have access to writing that filter in the web map. You could write it in Pro, or else modify the map's JSON using AGOL Assistant to paste the SQL in directly.
If that's too advanced, you can just keep modifying the existing filters. Try adding sets to the filter, so that you can combine "starts with 10" and "does not equal 10003" into a single condition.
Unfortunately, if you need a specific filter, you're going to need to do a lot of clicking. But there's really nothing stopping you from accomplishing this in the map.