Hi,
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.
Thanks!
Something like this could do what you want:
// 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 }] }
The workflow for this would be
So you want to do something like this?
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:
Thanks for your reply,
I want to add a new point feature that populates the coordinates into empty lat/long fields in an existing row in my table.
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.
Hope I answered all your questions!
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
var g = Geometry($feature); var x = g.x; var y = g.y; return { "result": { "attributes": { "x": x, "y": y } } }
the rule
Thanks for your help, I really appreciate it!
Thanks again!
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.