In need help with an arcade expression that will allow a 'pass/fail' value when an end user selects a point and whatever value that enter cause a pass/fail prompt. I currently have it setup properly when they are concerned whether or not a value is above or below a certain value but now they are wanting it to work for range values meaning if the value is between 6-9 then it would cause a pass prompt and any values outside of that would be a fail. The script below works for the greater/lesser than parameters but I'm having a hard time making it work for ranges.
Solved! Go to Solution.
To post code:
Your example will return null for zinc == 0.067! Also, it can be simplified like this:
var zinc = $feature.Zinc
var status = IIf(zinc > 0.067, 'Fail', 'Pass')
return `${zinc} mg/l (${status})`
For ranges, you just have to edit the boolean evaluation in IIf():
var zinc = $feature.Zinc
var status = IIf(zinc >= 6 && zinc <= 9, 'Pass', 'Fail')
return `${zinc} mg/l (${status})`
To post code:
Your example will return null for zinc == 0.067! Also, it can be simplified like this:
var zinc = $feature.Zinc
var status = IIf(zinc > 0.067, 'Fail', 'Pass')
return `${zinc} mg/l (${status})`
For ranges, you just have to edit the boolean evaluation in IIf():
var zinc = $feature.Zinc
var status = IIf(zinc >= 6 && zinc <= 9, 'Pass', 'Fail')
return `${zinc} mg/l (${status})`
Thank you Johannes! This worked perfectly!