<?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 Rule in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule/m-p/1200295#M58276</link>
    <description>&lt;P&gt;Something like this could do what you want (not tested):&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// Calculation Attribute Rule
// field: e (Text)
// triggers: Insert, Update, Delete

// write "INSERT" or "DELETE" into e
if $editcontext.editType != "UPDATE" {
    return $editcontext.editType
}

// define the fields you want to check
var checked_fields = ["a", "b", "c", "d"]

// build an array of fields where the value changed
var changed_fields = []
var old_attributes = Dictionary(Text($originalfeature)).attributes
var new_attributes = Dictionary(Text($feature)).attributes
for(var f in checked_fields) {
    var field = checked_fields[f]
    if(old_attributes[field] != new_attributes[field]) {
        Push(changed_fields, field)
    }
}

// compare geometry
if(!Equals(Geometry($originalfeature), Geometry($feature))) {
    Push(changed_fields, "geometry")
}

// concatenate the field names into a string and write that into e
return Concatenate(changed_fields, ", ")&lt;/LI-CODE&gt;</description>
    <pubDate>Mon, 08 Aug 2022 10:12:58 GMT</pubDate>
    <dc:creator>JohannesLindner</dc:creator>
    <dc:date>2022-08-08T10:12:58Z</dc:date>
    <item>
      <title>Attribute Rule</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule/m-p/1200199#M58270</link>
      <description>&lt;P&gt;I want to print the name of whatever column has changed in the layer with the attribute rule in a new column.&lt;/P&gt;&lt;P&gt;Sample;&lt;/P&gt;&lt;P&gt;I have a layer called Stops.&lt;BR /&gt;This layer consists of columns a, b, c, d.&lt;BR /&gt;I opened a new column named &lt;STRONG&gt;"e"&lt;/STRONG&gt; to show the changed column.&lt;BR /&gt;When the user changes column &lt;STRONG&gt;a, b, c or d&lt;/STRONG&gt;, I want to print the name of that column in &lt;STRONG&gt;column e.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Can u help?&lt;/P&gt;</description>
      <pubDate>Sun, 07 Aug 2022 12:01:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule/m-p/1200199#M58270</guid>
      <dc:creator>UğurcanGül</dc:creator>
      <dc:date>2022-08-07T12:01:28Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rule</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule/m-p/1200295#M58276</link>
      <description>&lt;P&gt;Something like this could do what you want (not tested):&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// Calculation Attribute Rule
// field: e (Text)
// triggers: Insert, Update, Delete

// write "INSERT" or "DELETE" into e
if $editcontext.editType != "UPDATE" {
    return $editcontext.editType
}

// define the fields you want to check
var checked_fields = ["a", "b", "c", "d"]

// build an array of fields where the value changed
var changed_fields = []
var old_attributes = Dictionary(Text($originalfeature)).attributes
var new_attributes = Dictionary(Text($feature)).attributes
for(var f in checked_fields) {
    var field = checked_fields[f]
    if(old_attributes[field] != new_attributes[field]) {
        Push(changed_fields, field)
    }
}

// compare geometry
if(!Equals(Geometry($originalfeature), Geometry($feature))) {
    Push(changed_fields, "geometry")
}

// concatenate the field names into a string and write that into e
return Concatenate(changed_fields, ", ")&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 08 Aug 2022 10:12:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule/m-p/1200295#M58276</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2022-08-08T10:12:58Z</dc:date>
    </item>
  </channel>
</rss>

