<?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: Calculation Rule- auto populate a point's coordinates into an existing row in Attribute Rules Questions</title>
    <link>https://community.esri.com/t5/attribute-rules-questions/calculation-rule-auto-populate-a-point-s/m-p/1200485#M508</link>
    <description>&lt;P&gt;Here is a filegdb example which a calculation rule updates the X and Y fields with the point's geometry coordinates on insert and update. We assign the field as empty so we can update multiple fields in one shot. The rule is simple&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var g = Geometry($feature);
var x = g.x;
var y = g.y;
return {
	"result": {
		"attributes": {
			"x": x,
			"y": y
		}
	}
}&lt;/LI-CODE&gt;&lt;P&gt;the rule&lt;BR /&gt;&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 08 Aug 2022 17:34:00 GMT</pubDate>
    <dc:creator>HusseinNasser2</dc:creator>
    <dc:date>2022-08-08T17:34:00Z</dc:date>
    <item>
      <title>Calculation Rule- auto populate a point's coordinates into an existing row</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/calculation-rule-auto-populate-a-point-s/m-p/1193055#M471</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was wondering if it's possible to auto populate the coordinates of a created point feature into an existing row rather than a new row.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jul 2022 18:17:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/calculation-rule-auto-populate-a-point-s/m-p/1193055#M471</guid>
      <dc:creator>V1212</dc:creator>
      <dc:date>2022-07-18T18:17:26Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation Rule- auto populate a point's coordinates into an existing row</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/calculation-rule-auto-populate-a-point-s/m-p/1194333#M474</link>
      <description>&lt;P&gt;So you want to do something like this?&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Click on Create Features, choose the point template&lt;/LI&gt;&lt;LI&gt;Click into the map&lt;/LI&gt;&lt;LI&gt;but instead of creating a new feature, the coordinates of an existing point are updated&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This could be kinda possible (you'd end up with a feature without geometry, so you wouldn't see it on the map). But, questions:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;What's your use case?&lt;/LI&gt;&lt;LI&gt;Why not use the edit tools to edit the existing point?&lt;/LI&gt;&lt;LI&gt;How would you decide which existing point to edit?&lt;/LI&gt;&lt;LI&gt;Coordinates as in numeric fields in the table or as in the actual point geometry?&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Thu, 21 Jul 2022 07:41:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/calculation-rule-auto-populate-a-point-s/m-p/1194333#M474</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2022-07-21T07:41:43Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation Rule- auto populate a point's coordinates into an existing row</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/calculation-rule-auto-populate-a-point-s/m-p/1195498#M480</link>
      <description>&lt;P&gt;&lt;EM&gt;Thanks for your reply,&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;So you want to do something like this?&lt;/EM&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;EM&gt;Click on Create Features, choose the point template&lt;/EM&gt;&lt;/LI&gt;&lt;LI&gt;&lt;EM&gt;Click into the map&lt;/EM&gt;&lt;/LI&gt;&lt;LI&gt;&lt;EM&gt;&lt;STRIKE&gt;but instead of creating a new feature, the coordinates of an existing point are updated&lt;/STRIKE&gt;&lt;/EM&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;I want to add a new point feature that populates the coordinates into empty lat/long fields in an existing row in my table.&lt;/P&gt;&lt;P&gt;I want an editor to add coordinates to places that have wrong attribute info so the data can be fixed downstream using the updated coordinates. I want as little manual editing done as possible so I thought this could be a good solution (no copy/pasting correct coordinates into lat/long fields). We don’t edit existing data, just update new corresponding fields.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope I answered all your questions!&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jul 2022 17:27:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/calculation-rule-auto-populate-a-point-s/m-p/1195498#M480</guid>
      <dc:creator>V1212</dc:creator>
      <dc:date>2022-07-25T17:27:41Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation Rule- auto populate a point's coordinates into an existing row</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/calculation-rule-auto-populate-a-point-s/m-p/1195755#M484</link>
      <description>&lt;P&gt;Something like this could do what you want:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;create a point feature class, add GlobalID&lt;/LI&gt;&lt;LI&gt;create a field in that fc that will work as a foreign key to the table you wish to edit&lt;/LI&gt;&lt;LI&gt;edit and add this attribute rule&lt;/LI&gt;&lt;/UL&gt;&lt;LI-CODE lang="javascript"&gt;// Calculation Attribute Rule on your point FC
// Field: empty
// Triggers: Insert
// Exclude from application evaluation

// get the rows that will be updated
var key = $feature.KeyField
var table = FeatureSetByName($datastore, "Database.Dataowner.TableYouWantToEdit", ["GlobalID", "KeyField"], false)
var rows = Filter(table, "KeyField = @key")

// create and fill the update array
var lat_long_attributes = {"LAT": Geometry($feature).y, "LONG": Geometry($feature).x}
var updates = []
for(var row in rows) {
    Push(updates, {"globalID": row.GlobalID, "attributes": lat_long_attributes}
}

// tell ArcGIS to edit the table
return {
    "edit" [{
        "className": "Database.Dataowner.TableYouWantToEdit",
        "updates": updates
    }]
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The workflow for this would be&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;copy the key of the feature you want to edit&lt;/LI&gt;&lt;LI&gt;create point feature --&amp;gt; paste key into the feature template, create the point in the correct location&lt;/LI&gt;&lt;LI&gt;the attribute rule will trigger and write the coordinates of the&amp;nbsp; new point into the lat/long fields of the row(s) you specified with the key&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Tue, 26 Jul 2022 07:00:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/calculation-rule-auto-populate-a-point-s/m-p/1195755#M484</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2022-07-26T07:00:08Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation Rule- auto populate a point's coordinates into an existing row</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/calculation-rule-auto-populate-a-point-s/m-p/1200485#M508</link>
      <description>&lt;P&gt;Here is a filegdb example which a calculation rule updates the X and Y fields with the point's geometry coordinates on insert and update. We assign the field as empty so we can update multiple fields in one shot. The rule is simple&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var g = Geometry($feature);
var x = g.x;
var y = g.y;
return {
	"result": {
		"attributes": {
			"x": x,
			"y": y
		}
	}
}&lt;/LI-CODE&gt;&lt;P&gt;the rule&lt;BR /&gt;&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Aug 2022 17:34:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/calculation-rule-auto-populate-a-point-s/m-p/1200485#M508</guid>
      <dc:creator>HusseinNasser2</dc:creator>
      <dc:date>2022-08-08T17:34:00Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation Rule- auto populate a point's coordinates into an existing row</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/calculation-rule-auto-populate-a-point-s/m-p/1216051#M581</link>
      <description>&lt;P&gt;Thanks for your help, I really appreciate it!&lt;/P&gt;</description>
      <pubDate>Mon, 26 Sep 2022 14:01:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/calculation-rule-auto-populate-a-point-s/m-p/1216051#M581</guid>
      <dc:creator>V1212</dc:creator>
      <dc:date>2022-09-26T14:01:18Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation Rule- auto populate a point's coordinates into an existing row</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/calculation-rule-auto-populate-a-point-s/m-p/1222823#M612</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;</description>
      <pubDate>Mon, 24 Oct 2022 17:00:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/calculation-rule-auto-populate-a-point-s/m-p/1222823#M612</guid>
      <dc:creator>V1212</dc:creator>
      <dc:date>2022-10-24T17:00:05Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation Rule- auto populate a point's coordinates into an existing row</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/calculation-rule-auto-populate-a-point-s/m-p/1222942#M614</link>
      <description>&lt;P&gt;Are you sure that you're creating it on the right feature class? This behavior sounds like you create the rule on the class you want to update.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Oct 2022 18:00:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/calculation-rule-auto-populate-a-point-s/m-p/1222942#M614</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2022-10-18T18:00:00Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation Rule- auto populate a point's coordinates into an existing row</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/calculation-rule-auto-populate-a-point-s/m-p/1222996#M617</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;</description>
      <pubDate>Mon, 24 Oct 2022 17:00:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/calculation-rule-auto-populate-a-point-s/m-p/1222996#M617</guid>
      <dc:creator>V1212</dc:creator>
      <dc:date>2022-10-24T17:00:20Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation Rule- auto populate a point's coordinates into an existing row</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/calculation-rule-auto-populate-a-point-s/m-p/1223004#M618</link>
      <description>&lt;P&gt;Yeah, as I thought.&lt;/P&gt;&lt;P&gt;You're adding the rule to the feature class you want to update. That means that you create a point, and then the rule triggers and edits a point in the same class.&lt;/P&gt;&lt;P&gt;The rule is meant to be created on a different point feature class that you use to edit the "real" feature class.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Oct 2022 19:02:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/calculation-rule-auto-populate-a-point-s/m-p/1223004#M618</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2022-10-18T19:02:10Z</dc:date>
    </item>
  </channel>
</rss>

