Select to view content in your preferred language

Batch Operations in ArcGIS for Power Automate

38
0
yesterday
AkshayHarshe
Esri Contributor
0 0 38

Introduction

ArcGIS for Power Automate is a powerful tool that enables you to automate workflows by integrating ArcGIS with various services. One significant functionality is the ability to add data to feature layers. However, as your data processing needs grow, you might find that migrating to batch operations becomes essential to improve efficiency and manage larger datasets effectively.

What are the new batch actions?

In 2024.2 release we introduced Batch actions that allow us to add or update multiple features in a single request. The following actions are added to the list

  • Add records to a feature layer (batch)
  • Update records in a feature layer (batch)

These actions will take Array of Features as their input. Notice the difference between Update a record in a feature layer Inputs vs Update records in a feature layer (batch)

AkshayHarshe_0-1747952063158.png

 

AkshayHarshe_1-1747952063159.png

 

Appropriate JSON structure for the Array of features can be found here.

To extract the schema of your Feature layer, access the REST endpoint of your ArcGIS server service and query the features at "/server/rest/services/FeatureService/<layer>/query". For ArcGIS Online, open Item details for the layer you are trying to query under item details and view the URL.

AkshayHarshe_2-1747952063160.png

Once at the query endpoint form, under Where, use 1=1 (or an OBJECTID you know) with Out Fields set to * and Format set to JSON.

If your data originates from sources other than a feature layer, such as Excel or a database where geometry information is stored in a text column, you must rename the column to "geometry" for the Batch actions to recognize it in Power Automate. Alternatively, you can create the required JSON structure using Power Automate built-in actions like Select, Compose, and Parse JSON from Data Operations, which will be useful.

Here is a sample JSON structure.

[{
    "geometry": {"x": 1234,"y": 1234},
    "attributes": {"name1": "value1", "name2": "value2"}
  },
  {
    "geometry": {"x": 1234, "y": 1234},
    "attributes": {"name1": "value1", "name2": "value2"}
}]

Are batch actions right for you?

When working with single feature operations such as `Create/Update a record in a feature layer` you typically add one or a few features at a time to your feature layer. This method is straightforward and can be sufficient for small-scale data additions or updates. There is no need to change the existing workflow as there are no performance gains.

Using these actions within a "For Each" loop becomes less efficient when handling a large number of records that need to be created or updated. It is advisable to consider migrating to batch actions in the following scenarios:

  • Updating dozens or thousands of records.
  • The flow is set to run frequently with numerous features.
  • Working with feature arrays can be a better alternative to configuring each field in a form for single record actions, particularly when dealing with feature services that contain many fields.
  • Performing copy operations.
Contributors
About the Author
I am a GIS professional working with ESRI since 2013. I have a passion for location-enabled services how it is important in today's analytics of the data-driven world. I am privileged to work as a Product Engineer on the ArcGIS Insights team where I get to materialize my passion and build a product that is driven by cutting-edge technology in this industry. When I am not doing GIS you will mostly find me taking photos and talking about photography.