<?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 Can a calculation rule update a record in the same feature class, same field, as the edited record? in Attribute Rules Questions</title>
    <link>https://community.esri.com/t5/attribute-rules-questions/can-a-calculation-rule-update-a-record-in-the-same/m-p/1332608#M1133</link>
    <description>&lt;P&gt;For example, if a user edits the common_name for OID1, I want the attribute rule to additionally update the common_name for OID 2. Is this possible?&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;OID&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;custom_id&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;common_name&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;1&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;"Group A"&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;"Name A"&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;2&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;"Group A"&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;"Name A"&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;3&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;"Group B"&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;"Name B"&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;4&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;"Group B"&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;"Name B"&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
    <pubDate>Tue, 26 Sep 2023 18:49:52 GMT</pubDate>
    <dc:creator>mfiegeeqt</dc:creator>
    <dc:date>2023-09-26T18:49:52Z</dc:date>
    <item>
      <title>Can a calculation rule update a record in the same feature class, same field, as the edited record?</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/can-a-calculation-rule-update-a-record-in-the-same/m-p/1332608#M1133</link>
      <description>&lt;P&gt;For example, if a user edits the common_name for OID1, I want the attribute rule to additionally update the common_name for OID 2. Is this possible?&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;OID&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;custom_id&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;common_name&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;1&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;"Group A"&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;"Name A"&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;2&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;"Group A"&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;"Name A"&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;3&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;"Group B"&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;"Name B"&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;4&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;"Group B"&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;"Name B"&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Tue, 26 Sep 2023 18:49:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/can-a-calculation-rule-update-a-record-in-the-same/m-p/1332608#M1133</guid>
      <dc:creator>mfiegeeqt</dc:creator>
      <dc:date>2023-09-26T18:49:52Z</dc:date>
    </item>
    <item>
      <title>Re: Can a calculation rule update a record in the same feature class, same field, as the edited record?</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/can-a-calculation-rule-update-a-record-in-the-same/m-p/1332905#M1134</link>
      <description>&lt;P&gt;I've wondered about this, too.&lt;/P&gt;&lt;P&gt;I posted it as an idea:&amp;nbsp;&lt;A href="https://community.esri.com/t5/attribute-rules-ideas/when-a-feature-is-edited-update-a-different/idi-p/1332902" target="_self"&gt;When a feature is edited, update a different feature in the same FC&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Sep 2023 13:33:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/can-a-calculation-rule-update-a-record-in-the-same/m-p/1332905#M1134</guid>
      <dc:creator>Bud</dc:creator>
      <dc:date>2023-09-27T13:33:30Z</dc:date>
    </item>
    <item>
      <title>Re: Can a calculation rule update a record in the same feature class, same field, as the edited record?</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/can-a-calculation-rule-update-a-record-in-the-same/m-p/1332926#M1135</link>
      <description>&lt;P&gt;Yes, that is possible.&lt;/P&gt;&lt;P&gt;You just have to take precautions against infinite loops (feature 1 updates f2, which in turn updates f1, which then updates f2, etc).&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// Calculation Attribute Rule on TestPoints
// field: empty
// Triggers: Update
// Exclude from application evaluation!

// get the old and new value
var old_value = $originalfeature.TextField1
var new_value = $feature.TextField1

// abort if value did not change
if(new_value == old_value) { return }

// get all features with the old value that aren't the current feature
var gid = $feature.GlobalID
var other_features = Filter(FeaturesetByName($datastore, "TestPoints"), "TextField1 = @old_value AND GlobalID &amp;lt;&amp;gt; @gid")

// create and fill an update array
var updates = []
for(var f in other_features) {
    Push(updates, {globalID: f.GlobalID, attributes: {TextField1: new_value}})
}

// instruct ArcGIS to update the other features
return {
    edit: [{
        className: "TestPoints",
        updates: updates
    }]
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Before:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JohannesLindner_0-1695823870649.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/81775i44B10513827BE69E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JohannesLindner_0-1695823870649.png" alt="JohannesLindner_0-1695823870649.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="JohannesLindner_1-1695823897924.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/81776iBD14666891CFA732/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JohannesLindner_1-1695823897924.png" alt="JohannesLindner_1-1695823897924.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After refreshing the table:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JohannesLindner_2-1695823919433.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/81777iB3FD2E0C4F553E44/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JohannesLindner_2-1695823919433.png" alt="JohannesLindner_2-1695823919433.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Sep 2023 14:12:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/can-a-calculation-rule-update-a-record-in-the-same/m-p/1332926#M1135</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2023-09-27T14:12:31Z</dc:date>
    </item>
    <item>
      <title>Re: Can a calculation rule update a record in the same feature class, same field, as the edited record?</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/can-a-calculation-rule-update-a-record-in-the-same/m-p/1338562#M1145</link>
      <description>&lt;P&gt;Any thoughts on this issue?&amp;nbsp;&lt;A href="https://community.esri.com/t5/attribute-rules-questions/calculation-works-and-does-not-work-depending-on/m-p/1336210#M1137" target="_self"&gt;Calculation works and does not work depending on number of features.&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Seems this user is using your code and is running into an issue. I can replicate this issue.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JS_Esri_0-1697544784320.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/83215i31E98C033F0C0B21/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JS_Esri_0-1697544784320.png" alt="JS_Esri_0-1697544784320.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/257092"&gt;@Aнастасия88&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;~Jake&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2023 12:15:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/can-a-calculation-rule-update-a-record-in-the-same/m-p/1338562#M1145</guid>
      <dc:creator>Jake_S</dc:creator>
      <dc:date>2023-10-17T12:15:01Z</dc:date>
    </item>
    <item>
      <title>Re: Can a calculation rule update a record in the same feature class, same field, as the edited record?</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/can-a-calculation-rule-update-a-record-in-the-same/m-p/1339003#M1146</link>
      <description>&lt;P&gt;Hi Jake, appreciate for your follow up regarding the problem that I have come across.&lt;/P&gt;&lt;P&gt;I still have not been able to figure out what the cause is. Hope someone will find a solution.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Oct 2023 07:42:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/can-a-calculation-rule-update-a-record-in-the-same/m-p/1339003#M1146</guid>
      <dc:creator>Aнастасия88</dc:creator>
      <dc:date>2023-10-18T07:42:42Z</dc:date>
    </item>
  </channel>
</rss>

