<?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 Re: Rule in ArcGIS Pro 3.0 wont validate, 2.6-2.9 zero issues. Does 3.0 have a new compiler? in Attribute Rules Questions</title>
    <link>https://community.esri.com/t5/attribute-rules-questions/rule-in-arcgis-pro-3-0-wont-validate-2-6-2-9-zero/m-p/1223138#M622</link>
    <description>&lt;P&gt;Clearly, it's late and I'm bad at life&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":rolling_on_the_floor_laughing:"&gt;🤣&lt;/span&gt;. How embarrassing, I should know better.&lt;/P&gt;</description>
    <pubDate>Wed, 19 Oct 2022 02:43:25 GMT</pubDate>
    <dc:creator>Jake_S</dc:creator>
    <dc:date>2022-10-19T02:43:25Z</dc:date>
    <item>
      <title>Rule in ArcGIS Pro 3.0 wont validate, 2.6-2.9 zero issues. Does 3.0 have a new compiler?</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/rule-in-arcgis-pro-3-0-wont-validate-2-6-2-9-zero/m-p/1222981#M615</link>
      <description>&lt;P&gt;Just testing in a new environment Pro 3.0 and noticed when applying an attribute rule to a field it there is a validation error '&amp;nbsp;Unexpected Error. Error on line 18. Unexpected null'. Code below. This rule validates in 2.9 (Image below).&lt;BR /&gt;&lt;BR /&gt;This rule simply updates a field used to rotate cartography points based on the lines direction.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var easementLines = Intersects(FeatureSetByName($datastore, "Easements_Lines", ['objectid'], false), $feature)
var parcelLines = Intersects(FeatureSetByName($datastore, "Parcels_Lines", ['objectid'], false), $feature)
var lotLines = Intersects(FeatureSetByName($datastore, "Lots_Lines", ['objectid'], false), $feature)

var x = null
if (Count(easementLines) &amp;gt; 0){
    var x = easementLines
}
else if (Count(parcelLines) &amp;gt; 0){
    var x = parcelLines
}
else if (Count(lotLines) &amp;gt; 0){
    var x = lotLines
}
if (!(x == null)){
    var line = first(x)
    var geom = Geometry(line)
    var pt0 = geom.paths[0][0]
    var brg = Bearing(pt0, Geometry($feature))
    if (brg &amp;gt; 90 &amp;amp;&amp;amp; brg &amp;lt;= 360) {
        return (450 - brg)
    }
    if (brg &amp;gt;= 0 &amp;amp;&amp;amp; brg &amp;lt;= 90) {
        return (90 - brg)
    }
return null
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JS_Esri_1-1666117649370.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/53860i609FA508A4AD910B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JS_Esri_1-1666117649370.png" alt="JS_Esri_1-1666117649370.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JS_Esri_0-1666117598656.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/53858i933849894641F6C3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JS_Esri_0-1666117598656.png" alt="JS_Esri_0-1666117598656.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any thoughts would be great.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Oct 2022 18:29:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/rule-in-arcgis-pro-3-0-wont-validate-2-6-2-9-zero/m-p/1222981#M615</guid>
      <dc:creator>Jake_S</dc:creator>
      <dc:date>2022-10-18T18:29:19Z</dc:date>
    </item>
    <item>
      <title>Re: Rule in ArcGIS Pro 3.0 wont validate, 2.6-2.9 zero issues. Does 3.0 have a new compiler?</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/rule-in-arcgis-pro-3-0-wont-validate-2-6-2-9-zero/m-p/1222989#M616</link>
      <description>&lt;P&gt;In line 17, you try to get the geometry of the line, but in lines 1-3 you explicitly tell Arcade to NOT load the geometries. Does it work if you change that?&lt;/P&gt;</description>
      <pubDate>Tue, 18 Oct 2022 18:39:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/rule-in-arcgis-pro-3-0-wont-validate-2-6-2-9-zero/m-p/1222989#M616</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2022-10-18T18:39:03Z</dc:date>
    </item>
    <item>
      <title>Re: Rule in ArcGIS Pro 3.0 wont validate, 2.6-2.9 zero issues. Does 3.0 have a new compiler?</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/rule-in-arcgis-pro-3-0-wont-validate-2-6-2-9-zero/m-p/1223031#M620</link>
      <description>&lt;P&gt;Edit: And &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/294341"&gt;@JohannesLindner&lt;/a&gt;&amp;nbsp; spotted it before I did, to consume the geometry of a feature that has been queried, the featureset should be created with return geometry set to true.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is a good practice to always check for null when you call `first`, First can return null if the featureset is empty, which can cause subsequent code to fail. And just to be safe, because the error is pointing in line 18 the geometry of the line might be null here so add a check for that too.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;    var line = first(x)
    //check if line is null
    if (line == null) return; //do nothing
    var geom = Geometry(line)
    if (is_empty(geom )) return; //check if the geometry is null&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now to explain "well it worked in 2.9 why does it fail in 3.0". To validate an Arcade script , AR picks a row in the table and makes that row $feature to do the validation against. It could be the case the 2.9 gives a different row than 3.0 and resulting in a failure in your script.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Oct 2022 20:10:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/rule-in-arcgis-pro-3-0-wont-validate-2-6-2-9-zero/m-p/1223031#M620</guid>
      <dc:creator>HusseinNasser2</dc:creator>
      <dc:date>2022-10-18T20:10:22Z</dc:date>
    </item>
    <item>
      <title>Re: Rule in ArcGIS Pro 3.0 wont validate, 2.6-2.9 zero issues. Does 3.0 have a new compiler?</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/rule-in-arcgis-pro-3-0-wont-validate-2-6-2-9-zero/m-p/1223138#M622</link>
      <description>&lt;P&gt;Clearly, it's late and I'm bad at life&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":rolling_on_the_floor_laughing:"&gt;🤣&lt;/span&gt;. How embarrassing, I should know better.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Oct 2022 02:43:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/rule-in-arcgis-pro-3-0-wont-validate-2-6-2-9-zero/m-p/1223138#M622</guid>
      <dc:creator>Jake_S</dc:creator>
      <dc:date>2022-10-19T02:43:25Z</dc:date>
    </item>
    <item>
      <title>Re: Rule in ArcGIS Pro 3.0 wont validate, 2.6-2.9 zero issues. Does 3.0 have a new compiler?</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/rule-in-arcgis-pro-3-0-wont-validate-2-6-2-9-zero/m-p/1223140#M623</link>
      <description>&lt;P&gt;Thank you for all this info! Still learning.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Oct 2022 02:29:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/rule-in-arcgis-pro-3-0-wont-validate-2-6-2-9-zero/m-p/1223140#M623</guid>
      <dc:creator>Jake_S</dc:creator>
      <dc:date>2022-10-19T02:29:18Z</dc:date>
    </item>
  </channel>
</rss>

