<?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: Help diagnose why attribute rule is producing no changes in data? in Attribute Rules Questions</title>
    <link>https://community.esri.com/t5/attribute-rules-questions/help-diagnose-why-attribute-rule-is-producing-no/m-p/1544852#M1586</link>
    <description>&lt;P&gt;With some more testing, this would check if the geometry changed, returning "Equal" if I just changed an attribute and "Not Equal" when I moved a vertex.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;if (Area($originalFeature) != Area($feature)){
    return 'Not equal';
} else {
    return 'Equal';
}&lt;/LI-CODE&gt;&lt;P&gt;when&lt;/P&gt;</description>
    <pubDate>Wed, 02 Oct 2024 17:00:03 GMT</pubDate>
    <dc:creator>KenBuja</dc:creator>
    <dc:date>2024-10-02T17:00:03Z</dc:date>
    <item>
      <title>Help diagnose why attribute rule is producing no changes in data?</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/help-diagnose-why-attribute-rule-is-producing-no/m-p/1544734#M1583</link>
      <description>&lt;P&gt;I have created an attribute rule that that seeks to do a few things.&amp;nbsp;&lt;/P&gt;&lt;P&gt;First, it checks to see if the geometry of the feature has changed from it's initial state.&amp;nbsp;&lt;/P&gt;&lt;P&gt;If it has, then it compares two values, the legal acreage from a plat and the calculated acreage from the geometry. If there is a difference of 10% of the legal acreage, then it is supposed to flag it as an error for review. If not not, then it flags it as ok.&amp;nbsp;&lt;/P&gt;&lt;P&gt;If the geometry of the original feature has not changed, however, then it simply returns the same value so that no changes are produced. My code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;var origGeometry = $originalFeature['Shape_Area'];

var newGeometry = $feature['Shape_Area']; 

var QAQC_Eval = iif(abs($feature.ERROR_ACRES) &amp;gt; ($feature.StatedArea * 0.10), "Acreage mismatch. Deeded acres and calculated acres do not fall within OCGIS tolerance.","Acreage ok. Deeded acres and calculated acres fall within OCGIS tolerance.");
//If the absolute value of error acres is greater than 10% of the stated acres, then report mismatch. Otherwise, report that it is acceptable.

if(origGeometry != newGeometry){
    return QAQC_Eval;
} else {
    return $feature.QAQC_Status;
}

//This expression checks to see if the geometry of a feature has changed. If it has, then it compares the deeded acreage to the calculated acreage. If there is a discrepancy larger then 10%, it will flag that feature with an error in the attribute table. Otherwise it will flag it as "Ok". 
  
  

&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;The expression says it is valid, but when editing the layer to test the conditions, no changes are ever made. I can intentionally create a feature that should return an error but nothing happens. I can't even tell if the rule is running or not. Is there something in the above code that I have missed? Any pointers?&lt;/P&gt;</description>
      <pubDate>Wed, 02 Oct 2024 13:42:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/help-diagnose-why-attribute-rule-is-producing-no/m-p/1544734#M1583</guid>
      <dc:creator>MDB_GIS</dc:creator>
      <dc:date>2024-10-02T13:42:40Z</dc:date>
    </item>
    <item>
      <title>Re: Help diagnose why attribute rule is producing no changes in data?</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/help-diagnose-why-attribute-rule-is-producing-no/m-p/1544753#M1584</link>
      <description>&lt;P&gt;What happens if you compare the geometries of the two features?&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;if (Geometry($originalFeature) != Geometry($feature)) {&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Oct 2024 14:08:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/help-diagnose-why-attribute-rule-is-producing-no/m-p/1544753#M1584</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2024-10-02T14:08:22Z</dc:date>
    </item>
    <item>
      <title>Re: Help diagnose why attribute rule is producing no changes in data?</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/help-diagnose-why-attribute-rule-is-producing-no/m-p/1544767#M1585</link>
      <description>&lt;P&gt;Ok! Made some progress! I updated the code to this based on your suggestion:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;//This expression checks to see if the geometry of a feature has changed. If it has, then it compares the deeded acreage to the calculated acreage. If there is a discrepancy larger then 10%, it will flag that feature with an error in the attribute table. Otherwise it will flag it as "Ok". 

var QAQC_Eval = iif(abs($feature.ERROR_ACRES) &amp;gt; ($feature.StatedArea * 0.10), "Acreage mismatch. Deeded acres and calculated acres do not fall within OCGIS tolerance.","Acreage ok. Deeded acres and calculated acres fall within OCGIS tolerance.");
//If the absolute value of error acres is greater than 10%, then report mismatch. Otherwise, report that it is acceptable.

if (Geometry($originalFeature) != Geometry($feature)){
    return QAQC_Eval;
} else {
    return $feature.QAQC_Status;
}

//This expression checks to see if the geometry of a feature has changed. If it has, then it compares the deeded acreage to the calculated acreage. If there is a discrepancy larger then 10%, it will flag that feature with an error in the attribute table. Otherwise it will flag it as "Ok".&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That at least produces the attribute edits. But it seems to be ignoring the check to see if the geometry changes. Even if I only edit the attributes without touching the geometry, the rule always fires. I need to be able to prevent it from making changes unless there has been a geometry update. Any ideas?&lt;/P&gt;</description>
      <pubDate>Wed, 02 Oct 2024 14:25:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/help-diagnose-why-attribute-rule-is-producing-no/m-p/1544767#M1585</guid>
      <dc:creator>MDB_GIS</dc:creator>
      <dc:date>2024-10-02T14:25:58Z</dc:date>
    </item>
    <item>
      <title>Re: Help diagnose why attribute rule is producing no changes in data?</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/help-diagnose-why-attribute-rule-is-producing-no/m-p/1544852#M1586</link>
      <description>&lt;P&gt;With some more testing, this would check if the geometry changed, returning "Equal" if I just changed an attribute and "Not Equal" when I moved a vertex.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;if (Area($originalFeature) != Area($feature)){
    return 'Not equal';
} else {
    return 'Equal';
}&lt;/LI-CODE&gt;&lt;P&gt;when&lt;/P&gt;</description>
      <pubDate>Wed, 02 Oct 2024 17:00:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/help-diagnose-why-attribute-rule-is-producing-no/m-p/1544852#M1586</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2024-10-02T17:00:03Z</dc:date>
    </item>
  </channel>
</rss>

