<?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: Attribute rules causing failures in field calculations in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-causing-failures-in-field/m-p/1397970#M80628</link>
    <description>&lt;P&gt;posted a workaround ,can you try?&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 19 Mar 2024 16:59:18 GMT</pubDate>
    <dc:creator>HusseinNasser2</dc:creator>
    <dc:date>2024-03-19T16:59:18Z</dc:date>
    <item>
      <title>Attribute rules causing failures in field calculations</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-causing-failures-in-field/m-p/203536#M8988</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've implemented some attribute rules for a feature class to calculate immediately on insert and update.&amp;nbsp; I know the rules work because when I manually edit the table, or use arcpy.UpdateCursor() to iterate through the table, the rules are enforced.&amp;nbsp; The problem comes when I try to use Calculate Field(s) geoprocessing tool I get an Error 999999 and an "Arcade error: Field not found" for a field that definitely exists.&amp;nbsp; I've attached one of the rules and the error message.&amp;nbsp; Notably there's no GlobalID listed in the error message despite the fact that all the features have a GlobalID.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="jive-emoji image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/482742_calculate_fail_rules.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="jive-emoji jive-image image-2 j-img-original" src="https://community.esri.com/legacyfs/online/482743_calculate_fail.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any thoughts why this happens?&amp;nbsp; For now I'm just disabling attribute rules but I'd like to figure out what's happening. I'm using ArcGIS Pro 2.4.3.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Feb 2020 20:11:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-causing-failures-in-field/m-p/203536#M8988</guid>
      <dc:creator>SamSzotkowski1</dc:creator>
      <dc:date>2020-02-19T20:11:15Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute rules causing failures in field calculations</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-causing-failures-in-field/m-p/203537#M8989</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have run into a similar problem with Calculate Fields.&amp;nbsp; I wrote my expression in Arcade but never changed the expression type from Python (it is Python by default).&amp;nbsp; Once I changed the expression type to Arcade it fixed the problem.&amp;nbsp; Just a thought of something to check.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Mar 2020 13:33:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-causing-failures-in-field/m-p/203537#M8989</guid>
      <dc:creator>SeanSummers_CC</dc:creator>
      <dc:date>2020-03-13T13:33:02Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute rules causing failures in field calculations</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-causing-failures-in-field/m-p/203538#M8990</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Sam&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;are you still running into this problem? We would like to take a closer look and reproduce in the latest software. Can you send us file gdb of a sample data that repro ? would appreciate it&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is ok to use PYTHON to calculate your expressions because that will eventually trigger an update on the row which will execute the attribute rule.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Hussein&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Sep 2020 22:09:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-causing-failures-in-field/m-p/203538#M8990</guid>
      <dc:creator>HusseinNasser2</dc:creator>
      <dc:date>2020-09-18T22:09:44Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute rules causing failures in field calculations</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-causing-failures-in-field/m-p/1386590#M79283</link>
      <description>&lt;P&gt;Did this ever get resolved? I'm experiencing the same issue in Pro v3.2.1.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Feb 2024 04:06:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-causing-failures-in-field/m-p/1386590#M79283</guid>
      <dc:creator>matt_g_g</dc:creator>
      <dc:date>2024-02-26T04:06:10Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute rules causing failures in field calculations</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-causing-failures-in-field/m-p/1386591#M79284</link>
      <description>&lt;P&gt;Sorry, should have included a bit more info before hitting submit!&lt;/P&gt;&lt;P&gt;If I try to run calculate field from the attribute table I get an error in regard to the attribute rules setup on the table but if I use an update cursor via arcpy.da module then I don't get an error and everything executes as expected.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Feb 2024 04:09:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-causing-failures-in-field/m-p/1386591#M79284</guid>
      <dc:creator>matt_g_g</dc:creator>
      <dc:date>2024-02-26T04:09:30Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute rules causing failures in field calculations</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-causing-failures-in-field/m-p/1397634#M80583</link>
      <description>&lt;P&gt;Any chance you resolved your issue? I'm encountering something very similar in Field Maps. Tagging&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/346994"&gt;@HusseinNasser2&lt;/a&gt;&amp;nbsp;if you have any insight.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Mar 2024 02:17:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-causing-failures-in-field/m-p/1397634#M80583</guid>
      <dc:creator>LanceKirby2</dc:creator>
      <dc:date>2024-03-19T02:17:29Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute rules causing failures in field calculations</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-causing-failures-in-field/m-p/1397969#M80627</link>
      <description>&lt;P&gt;Can we try the following?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When running python on a class with attribute rules you must specify all the fields required by the attribute rule in the python cursor.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is an example&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a table with three fields a,b, and c.&lt;/P&gt;&lt;P&gt;Field&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;c&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;has an attribute rule&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;return $feature.b * 2. So the rule require fields b and c&lt;/P&gt;&lt;P&gt;Because b and c are required by the attribute rules those fields must by passed to python as follows.&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;&lt;LI-CODE lang="python"&gt;def update_standalone(fields):
    with arcpy.da.UpdateCursor(str(gdb / 'standalone'), fields) as cursor:
        for row in cursor:
            row[0] += 1
            cursor.updateRow(row)


print('Running')
update_standalone(['a', 'b', 'c'])  # Succeeds 

# passing only a will fail
# update_standalone(['a'])  # RuntimeError: Failed to evaluate Arcade expression. 
# passing only b will also fail 
# update_standalone(['b'])  # SystemError: &amp;lt;method 'updateRow' of 'da.UpdateCursor' objects&amp;gt; returned NULL without setting an error
# passing all fileds or the required fields for attribute rules will succeed
# update_standalone(['a', 'b', 'c'])  # Succeeds 
# update_standalone(['b', 'c'])  # Succeeds
print('Done')&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Mar 2024 16:58:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-causing-failures-in-field/m-p/1397969#M80627</guid>
      <dc:creator>HusseinNasser2</dc:creator>
      <dc:date>2024-03-19T16:58:50Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute rules causing failures in field calculations</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-causing-failures-in-field/m-p/1397970#M80628</link>
      <description>&lt;P&gt;posted a workaround ,can you try?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Mar 2024 16:59:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-causing-failures-in-field/m-p/1397970#M80628</guid>
      <dc:creator>HusseinNasser2</dc:creator>
      <dc:date>2024-03-19T16:59:18Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute rules causing failures in field calculations</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-causing-failures-in-field/m-p/1398118#M80639</link>
      <description>&lt;P&gt;Hope this helps&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/769316"&gt;@matt_g_g&lt;/a&gt;. If you have a moment&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/346994"&gt;@HusseinNasser2&lt;/a&gt;&amp;nbsp;my issue is a little different.. I can point you over to this thread if you would be willing to offer some advice.&amp;nbsp;&lt;A href="https://community.esri.com/t5/arcgis-field-maps-questions/field-maps-constraint-rule-feature-form-caching/td-p/1396877" target="_blank"&gt;https://community.esri.com/t5/arcgis-field-maps-questions/field-maps-constraint-rule-feature-form-caching/td-p/1396877&lt;/A&gt;. It would be much appreciated!&lt;/P&gt;</description>
      <pubDate>Tue, 19 Mar 2024 22:22:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rules-causing-failures-in-field/m-p/1398118#M80639</guid>
      <dc:creator>LanceKirby2</dc:creator>
      <dc:date>2024-03-19T22:22:01Z</dc:date>
    </item>
  </channel>
</rss>

