<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Evaulation of script expression returned not a number or infinity. in Attribute Rules Questions</title>
    <link>https://community.esri.com/t5/attribute-rules-questions/evaulation-of-script-expression-returned-not-a/m-p/1394698#M1350</link>
    <description>&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;The flow potential attribute rule works fine when I edit attributes of an existing feature.&amp;nbsp;&lt;/P&gt;&lt;P&gt;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.)&lt;/P&gt;&lt;P&gt;ArcGIS Pro version: 3.2.1&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;PT_STATIC: static flow, a value entered by fire dept staff during flow test&lt;/LI&gt;&lt;LI&gt;PT_RESIDU: residual flow, " "&lt;/LI&gt;&lt;LI&gt;PT_GPM: calculated flow, another attribute rule in the table calculates this value.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var poten = 0

if(!IsEmpty($feature.PT_STATIC) &amp;amp;&amp;amp; !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 &amp;gt; 0) &amp;amp;&amp;amp; ($feature.PT_GPM != null) &amp;amp;&amp;amp; ($feature.PT_RESIDU &amp;gt; 0) &amp;amp;&amp;amp; ($feature.PT_RESIDU != null) &amp;amp;&amp;amp; ($feature.PT_STATIC &amp;gt; 0) &amp;amp;&amp;amp; ($feature.PT_STATIC != null), poten, 0)
}


return poten&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 12 Mar 2024 15:31:35 GMT</pubDate>
    <dc:creator>Corey_Greenfield</dc:creator>
    <dc:date>2024-03-12T15:31:35Z</dc:date>
    <item>
      <title>Evaulation of script expression returned not a number or infinity.</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/evaulation-of-script-expression-returned-not-a/m-p/1394698#M1350</link>
      <description>&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;The flow potential attribute rule works fine when I edit attributes of an existing feature.&amp;nbsp;&lt;/P&gt;&lt;P&gt;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.)&lt;/P&gt;&lt;P&gt;ArcGIS Pro version: 3.2.1&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;PT_STATIC: static flow, a value entered by fire dept staff during flow test&lt;/LI&gt;&lt;LI&gt;PT_RESIDU: residual flow, " "&lt;/LI&gt;&lt;LI&gt;PT_GPM: calculated flow, another attribute rule in the table calculates this value.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var poten = 0

if(!IsEmpty($feature.PT_STATIC) &amp;amp;&amp;amp; !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 &amp;gt; 0) &amp;amp;&amp;amp; ($feature.PT_GPM != null) &amp;amp;&amp;amp; ($feature.PT_RESIDU &amp;gt; 0) &amp;amp;&amp;amp; ($feature.PT_RESIDU != null) &amp;amp;&amp;amp; ($feature.PT_STATIC &amp;gt; 0) &amp;amp;&amp;amp; ($feature.PT_STATIC != null), poten, 0)
}


return poten&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2024 15:31:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/evaulation-of-script-expression-returned-not-a/m-p/1394698#M1350</guid>
      <dc:creator>Corey_Greenfield</dc:creator>
      <dc:date>2024-03-12T15:31:35Z</dc:date>
    </item>
    <item>
      <title>Re: Evaulation of script expression returned not a number or infinity.</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/evaulation-of-script-expression-returned-not-a/m-p/1394785#M1351</link>
      <description>&lt;P&gt;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&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2024 17:45:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/evaulation-of-script-expression-returned-not-a/m-p/1394785#M1351</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2024-03-12T17:45:31Z</dc:date>
    </item>
    <item>
      <title>Re: Evaulation of script expression returned not a number or infinity.</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/evaulation-of-script-expression-returned-not-a/m-p/1395505#M1354</link>
      <description>&lt;P&gt;...yup that was it. Thanks!!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Mar 2024 18:32:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/evaulation-of-script-expression-returned-not-a/m-p/1395505#M1354</guid>
      <dc:creator>Corey_Greenfield</dc:creator>
      <dc:date>2024-03-13T18:32:22Z</dc:date>
    </item>
  </channel>
</rss>

