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
- PT_STATIC: static flow, a value entered by fire dept staff during flow test
- PT_RESIDU: residual flow, " "
- PT_GPM: calculated flow, another attribute rule in the table calculates this value.
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