I am trying to assign an attribute rule that calculates fire hydrant flow potential at 20 psi. The arcade expression works fine, however when I try to create a new feature, I get an error that says, "Failed to create, evaluation of script expression returned not a number or infinity," and it references the attribute rule for calculating flow potential. I get the error as soon as I try to drop a new point.
The flow potential attribute rule works fine when I edit attributes of an existing feature.
The rule triggers are "insert" and "update." Exclude from application evaluation is checked, (I've tested enabling and disabling this option, both produce the error.)
ArcGIS Pro version: 3.2.1
var poten = 0
if(!IsEmpty($feature.PT_STATIC) && !IsEmpty($feature.PT_RESIDU))
{
var x = pow(($feature.PT_STATIC-20)/(($feature.PT_STATIC)-($feature.PT_RESIDU)), 0.54)
poten = round(($feature.PT_GPM * x), 0)
IIf(($feature.PT_GPM > 0) && ($feature.PT_GPM != null) && ($feature.PT_RESIDU > 0) && ($feature.PT_RESIDU != null) && ($feature.PT_STATIC > 0) && ($feature.PT_STATIC != null), poten, 0)
}
return poten
Solved! Go to Solution.
You're checking if PT_STATIC and PT_RESIDU are empty, but not if PT_STATIC - PT_RESIDU = 0. If that's the case, x will have a value of Infinity
You're checking if PT_STATIC and PT_RESIDU are empty, but not if PT_STATIC - PT_RESIDU = 0. If that's the case, x will have a value of Infinity
...yup that was it. Thanks!!