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.
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
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)
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.
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"}
}]
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:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.