<?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: Error &amp;quot;The evaluation of attribute rules is cyclic or exceeds maximum cascading level&amp;quot; in Attribute Rules Questions</title>
    <link>https://community.esri.com/t5/attribute-rules-questions/error-quot-the-evaluation-of-attribute-rules-is/m-p/1613989#M1761</link>
    <description>&lt;P&gt;I was able to resolve the update-related issue.&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/188597"&gt;@MikeMillerGIS&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;I think the issue was with '||'. It works when I use '&amp;amp;&amp;amp;' function in IF. I should have mentioned it before...&lt;/P&gt;&lt;P&gt;Thank you so much&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt; for helping me in resolving this error. I really appreciate your help.&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Geetesh&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 13 May 2025 12:24:48 GMT</pubDate>
    <dc:creator>GeeteshSingh07</dc:creator>
    <dc:date>2025-05-13T12:24:48Z</dc:date>
    <item>
      <title>Error "The evaluation of attribute rules is cyclic or exceeds maximum cascading level"</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/error-quot-the-evaluation-of-attribute-rules-is/m-p/1613949#M1756</link>
      <description>&lt;P&gt;I am working on attribute rule. It is applied on two feature classes:&lt;BR /&gt;1. Main_FC&lt;BR /&gt;2. FC_Anno&lt;/P&gt;&lt;P&gt;The attribute rule on Main_FC is triggered on 'Update'. The rule is:&lt;/P&gt;&lt;LI-CODE lang="java"&gt;var globalId = $feature.GLOBALID;
var attach_anno = FeatureSetByName($datastore, "FC_Anno", ["FEATUREGLOBALID", "GLOBALID"], true);
var related_feature_anno = Filter(attach_anno, "FEATUREGLOBALID = @globalId");

if (related_feature_anno != null) {
    var updates = [];
    for (var f in related_feature_anno) {
        Push(updates, {
            'globalId': f.GLOBALID,
            'attributes': {
                'NAME': $feature.NAME
            }
        });
    }
    return {
        'edit': [{
            'className': 'FC_Anno',
            'updates': updates
        }]
    };
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The attribute rule on FC_Anno is triggered on 'Insert &amp;amp; Update'. The rule is:&lt;/P&gt;&lt;LI-CODE lang="java"&gt;var fglobalId = $feature.FEATUREGLOBALID;
var main_fc = FeatureSetByName($datastore, "Main_FC", ["GLOBALID"], true);
var related_main_fc = Filter(main_fc, "GLOBALID = @fglobalId");

if (related_main_fc != null) {
    var updates = [];
    for (var f in related_main_fc) {
        Push(updates, {
            'globalId': f.GLOBALID,
            'attributes': {
                'NAME': $feature.NAME
            }
        });
    }
    return {
        'edit': [{
            'className': 'Main_FC',
            'updates': updates
        }]
    };
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The attribute rule works fine if I disable any one of them. When both of them are enabled together, it gives an error:&amp;nbsp;The evaluation of attribute rules is cyclic or exceeds maximum cascading level.&lt;/P&gt;&lt;P&gt;I looked into some of community discussions &amp;amp; solutions suggested by&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/346994"&gt;@HusseinNasser2&lt;/a&gt;&amp;nbsp;, and I understand&amp;nbsp;when one feature is edited, it triggers the rule on the other class, which again edits the first class, triggering the rule again... and so on. This causes a cyclic dependency, which leads to the cascading evaluation error. However, I am still struggling to resolve this issue.&lt;/P&gt;&lt;P&gt;Any help on this will greatly be appreciated. Thank you.&lt;/P&gt;</description>
      <pubDate>Tue, 13 May 2025 09:52:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/error-quot-the-evaluation-of-attribute-rules-is/m-p/1613949#M1756</guid>
      <dc:creator>GeeteshSingh07</dc:creator>
      <dc:date>2025-05-13T09:52:28Z</dc:date>
    </item>
    <item>
      <title>Re: Error "The evaluation of attribute rules is cyclic or exceeds maximum cascading level"</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/error-quot-the-evaluation-of-attribute-rules-is/m-p/1613960#M1757</link>
      <description>&lt;P&gt;You need to add a check in each that if&amp;nbsp;$feature.NAME == f.NAME, do not update it and exclude it from the return edit payload&lt;/P&gt;</description>
      <pubDate>Tue, 13 May 2025 10:06:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/error-quot-the-evaluation-of-attribute-rules-is/m-p/1613960#M1757</guid>
      <dc:creator>MikeMillerGIS</dc:creator>
      <dc:date>2025-05-13T10:06:49Z</dc:date>
    </item>
    <item>
      <title>Re: Error "The evaluation of attribute rules is cyclic or exceeds maximum cascading level"</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/error-quot-the-evaluation-of-attribute-rules-is/m-p/1613976#M1758</link>
      <description>&lt;P&gt;Thank you &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/188597"&gt;@MikeMillerGIS&lt;/a&gt;&amp;nbsp;for the suggestion. I tried this, it gives no error but also doesn't update the field. May be because I added return statement inside the for loop now?&lt;/P&gt;&lt;P&gt;var fglobalId = $feature.FEATUREGLOBALID;&lt;BR /&gt;var main_fc = FeatureSetByName($datastore, "Main_FC", ["GLOBALID"], true);&lt;BR /&gt;var related_main_fc = Filter(main_fc, "GLOBALID = @fglobalId");&lt;/P&gt;&lt;P&gt;if (related_main_fc != null) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var updates = [];&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (var f in related_main_fc) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Push(updates, {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'globalId': f.GLOBALID,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'attributes': {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'NAME': $feature.NAME&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;/P&gt;&lt;P&gt;If ($feature.NAME == f.NAME ) {&lt;/P&gt;&lt;P&gt;return}&lt;/P&gt;&lt;P&gt;Else{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'edit': [{&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'className': 'Main_FC',&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'updates': updates&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }]&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;}&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;</description>
      <pubDate>Tue, 13 May 2025 11:41:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/error-quot-the-evaluation-of-attribute-rules-is/m-p/1613976#M1758</guid>
      <dc:creator>GeeteshSingh07</dc:creator>
      <dc:date>2025-05-13T11:41:29Z</dc:date>
    </item>
    <item>
      <title>Re: Error "The evaluation of attribute rules is cyclic or exceeds maximum cascading level"</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/error-quot-the-evaluation-of-attribute-rules-is/m-p/1613979#M1759</link>
      <description>&lt;P&gt;You need to check if each row has the same name.&amp;nbsp; &amp;nbsp; Try this:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var fglobalId = $feature.FEATUREGLOBALID;
var main_fc = FeatureSetByName($datastore, "Main_FC", ["GLOBALID", "NAME"], false);
var related_main_fc = Filter(main_fc, "GLOBALID = @fglobalId");

var updates = [];
for (var f in related_main_fc) {
    if ($feature.NAME == f.NAME){
      continue;
    }
    Push(updates, {
        'globalId': f.GLOBALID,
        'attributes': {
            'NAME': $feature.NAME
        }
    });
}
if (Count(updates) == 0 ){
    return
}
return {
    'edit': [{
        'className': 'Main_FC',
        'updates': updates
    }]
};&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;* Edited code, no reason to return Geometry and also needed to add NAME to the FeatureSetByName constructor&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 May 2025 11:48:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/error-quot-the-evaluation-of-attribute-rules-is/m-p/1613979#M1759</guid>
      <dc:creator>MikeMillerGIS</dc:creator>
      <dc:date>2025-05-13T11:48:08Z</dc:date>
    </item>
    <item>
      <title>Re: Error "The evaluation of attribute rules is cyclic or exceeds maximum cascading level"</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/error-quot-the-evaluation-of-attribute-rules-is/m-p/1613985#M1760</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/188597"&gt;@MikeMillerGIS&lt;/a&gt;&amp;nbsp;, unfortunately, it still doesn't work. It doesn't update now. In my original code, I have 4 fields such as NAME, NAME1, NAME2, NAME3. I have added all of them in&amp;nbsp;&lt;SPAN&gt;FeatureSetByName constructor . Also, in attributes section &amp;amp; IF block:&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;    if ($feature.NAME == f.NAME || $feature.NAME1 == f.NAME1 || $feature.NAME2 == f.NAME2 || $feature.NAME3 == f.NAME3){
      continue;
    }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 May 2025 12:11:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/error-quot-the-evaluation-of-attribute-rules-is/m-p/1613985#M1760</guid>
      <dc:creator>GeeteshSingh07</dc:creator>
      <dc:date>2025-05-13T12:11:44Z</dc:date>
    </item>
    <item>
      <title>Re: Error "The evaluation of attribute rules is cyclic or exceeds maximum cascading level"</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/error-quot-the-evaluation-of-attribute-rules-is/m-p/1613989#M1761</link>
      <description>&lt;P&gt;I was able to resolve the update-related issue.&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/188597"&gt;@MikeMillerGIS&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;I think the issue was with '||'. It works when I use '&amp;amp;&amp;amp;' function in IF. I should have mentioned it before...&lt;/P&gt;&lt;P&gt;Thank you so much&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt; for helping me in resolving this error. I really appreciate your help.&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Geetesh&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 May 2025 12:24:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/error-quot-the-evaluation-of-attribute-rules-is/m-p/1613989#M1761</guid>
      <dc:creator>GeeteshSingh07</dc:creator>
      <dc:date>2025-05-13T12:24:48Z</dc:date>
    </item>
    <item>
      <title>Re: Error "The evaluation of attribute rules is cyclic or exceeds maximum cascading level"</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/error-quot-the-evaluation-of-attribute-rules-is/m-p/1613995#M1762</link>
      <description>&lt;P&gt;You still should only change the name field when it is different.&amp;nbsp; So you should look at doing it this way:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// Need the expects as we are accessing attributes via variable key, this tells the code to retrieve these fields
Expects($feature, "NAME","NAME1","NAME2","NAME3");
var fglobalId = $feature.FEATUREGLOBALID;
var name_fields = ["NAME","NAME1","NAME2","NAME3"];
var main_fc = FeatureSetByName($datastore, "Main_FC", ["GLOBALID", "NAME","NAME1","NAME2","NAME3"], false);
var related_main_fc = Filter(main_fc, "GLOBALID = @fglobalId");

var updates = [];
for (var f in related_main_fc) {
    var atts = {}
    for (var i in name_fields){
        var name_field = name_fields[i];
        if ($feature[name_field] == f[name_field]){
            continue;
        }
        atts[name_field] = $feature[name_field];
    }
    // IsEmpty does not work on dicts, so convert to text to see if empty
    if (text(atts) == '{}'){
        continue;
    }
    Push(updates, {
        'globalId': f.GLOBALID,
        'attributes': {
            'NAME': $feature.NAME
        }
    });
}
if (Count(updates) == 0 ){
    return;
}
return {
    'edit': [{
        'className': 'Main_FC',
        'updates': updates
    }]
};&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 May 2025 12:45:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/error-quot-the-evaluation-of-attribute-rules-is/m-p/1613995#M1762</guid>
      <dc:creator>MikeMillerGIS</dc:creator>
      <dc:date>2025-05-13T12:45:56Z</dc:date>
    </item>
  </channel>
</rss>

