- I have a field named: $feature["POSTAL_CODE"]. It contains zip codes.
- I also have a list of zip codes: 28712, 28717, 28734 , 28736 , 28741...
- My goal is to check each row of $feature["POSTAL_CODE"] against my list and if a code on my list is present return a 1 otherwise a blank
- I put together the code below which works as intended, the only issue is that some of the zip codes in $feature["POSTAL_CODE"] are in zip+4 format (ex: 28712-xyz). For these row my code does not work. I'm only concerned that the first 5 characters of the of the zip code string match. Is there a way to modify or rewrite this so that it works for the handful of rows that have the zip+4 format?
var zip = $feature["POSTAL_CODE"]
var aoi = ['28712','28717','28734','28736','28741']
IIF( indexof(aoi, zip ) > 0 ,'1',"")

I'm relatively new to arcade so forgive me I refer to anything incorrectly. Also if any additional information is needed please let me know. This is where I stand:
Thanks