Select to view content in your preferred language

Power automate update geometry using Lat and Lon

337
3
3 weeks ago
vijaybadugu
Frequent Contributor

I Published a Hosted feature service  using query layer with Lat and Lons from non spatial database  on to the ArcGIS Online. I just wanted to create a Power Automate, if some thing changes in non spatial database like lat and long, it should update the feature layer without writing a new python script to update that hosted feature service. 

I guess, it is possible to update through arcgis online connector in Power automate. Could some one help us to solve this issue?

 

0 Kudos
3 Replies
VenkataKondepati
Occasional Contributor

Here’s a minimal, working pattern (no Python needed):

Flow outline (text key or GlobalID)

Trigger (pick one):

  • SQL Server / PostgreSQL row change trigger (premium) — fires on update

  • or a Scheduled flow that queries rows changed since last run (using a LastModified column)

Steps:

  1. Get changed row (must include a unique key and lat, lon).

    • Prefer a stable key (e.g., AssetID). Don’t use OBJECTID.

    • If you can store the feature’s GlobalID in the DB, even better.

  2. ArcGIS Online → Update a record in a feature layer

    • Where clause (string key):

       
      AssetID = '@{triggerOutputs()?['body/AssetID']}'

      (If numeric: no quotes.)
      Or, if you stored it:

       
      GlobalID = '@{triggerOutputs()?['body/FeatureGlobalID']}'
    • Attributes: map fields you want to update (e.g., Status, Notes, etc.)

    • Geometry (point):

       
      { "x": @{triggerOutputs()?['body/lon']}, "y": @{triggerOutputs()?['body/lat']}, "spatialReference": { "wkid": 4326 } }

      (If your layer is in Web Mercator 3857/102100, either send 4326 and let the service project, or pre-project before sending.)

  3. (Optional) Upsert logic

    • If the update returns 0 records affected, call Create a record in a feature layer with the same attributes + geometry (i.e., insert when missing).

Gotchas to avoid

  • OBJECTID is not stable → don’t match on it. Use a real business key or store the GlobalID back to your DB when you first create features.

  • Ensure lat/lon are not null; skip the update if either is blank.

  • If many rows change at once, switch to Update records in a feature layer (batch) and pass a WHERE like AssetID IN ('A1','A2',...), or loop with concurrency 1–5 to avoid throttling.

  • Keep the field names identical between your DB and the feature layer (or map them carefully in Attributes).

Quick start field plan

  • In your DB table: AssetID (unique), lat, lon, Status, LastModified

  • In the hosted feature layer: same fields + GlobalID (enabled)

  • (Optional) Store the feature’s GlobalID back to your DB on first insert to make future updates bulletproof.

If you share your actual key/field names (and the layer’s WKID), I’ll give you the exact WHERE line and the Geometry JSON you can paste into the Power Automate action.

0 Kudos
vijaybadugu
Frequent Contributor

Thanks . How do I update lat and Lon for a feature class in geodatabase ? Do we need to publish as feature layer to update ?

0 Kudos
gis_KIWI4
Frequent Contributor

@vijaybadugu - That's the easier option. PowerAutomate can update feature layers. 
I don't think there is any action within PowerAuotmate to update GDB directly unless you want to update the SQL DB directly. I would advise against the direct DB updates as they bypass the tracking and any attribute rules, etc. 

0 Kudos