Evaulation of script expression returned not a number or infinity.

207
2
Jump to solution
03-12-2024 08:31 AM
Corey_Greenfield
New Contributor

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

 

 

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
KenBuja
MVP Esteemed Contributor

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

View solution in original post

2 Replies
KenBuja
MVP Esteemed Contributor

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

Corey_Greenfield
New Contributor

...yup that was it. Thanks!! 

0 Kudos