Select to view content in your preferred language

Arcade if/or/default statements

2787
10
Jump to solution
02-25-2021 06:24 AM
aroininen
New Contributor III

Hello community,

I am having a problem adding a logical function into an arcade state I have scraped together from the web. I am not a programmer more of a edit existing code kind of person. I will try to keep this simple.

Here is the expression I have that intersects features and provides results for what its within - landuse info

var intersectLayer =Intersects(FeatureSetByName($map,"LandUse - h Provision Overlay"), Buffer($feature, -10, 'feet'))

var Hazard = "";

for (var f in intersectLayer) {
if (Hazard == "") {
Hazard = f.NAME
} else {
Hazard += " And " + f.NAME;}}

return Hazard

the result is this:

aroininen_1-1614262634335.png

I don't know how to insert a logical function into this expression so empty values display "n/a"

I have tried: IIf , IsEmpty, DefaultValue all kinds I just don't know how to fit them in

any help would be greatly appreciated!!!

Thanks

Aaron

 

also, can someone explained what the word hazard is for? it was just with the code so I left it in!

thanks again

 

 

 

 

0 Kudos
10 Replies
aroininen
New Contributor III

My bad - I had the $mapp \layer wrong!

nailed it!!

Thanks for all your help - I will click solved!!

aroininen_0-1614702278585.png

 

 

0 Kudos