Batch API request using power automate

Batching is always a vital mechanism to handle large data processing. This also helps in the performance and the resource utilisation better. Power Automate batching elevates the low code no code approach to new level and also helps to address lot of data processing scenarios. Changeset is also another great feature to make the transaction atomic in a way that one failure in the whole batch will be rollbacked. Combining batch and changeset will be a great addition to process Dataverse data.

The Dataverse connector got changeset action, this can be able to rollback those operation that happened within the changeset block. But there is not Batch action currently available to configure.

The batch can be achieved using the HTTP with Azure AD connector. The header information can be configured as below. The connection can be made specifying Base Resource URL and Azure AD Resource URI as https://{ORG URI}.

The payload i.e. body can be formed using looping if you need a dynamic request or else formed manually. The payload request (create/update/retrieve) format can be reference here. The format will look something like as below.

Content-Type: multipart/mixed;boundary=changeset_{{HASH}} 


Content-Type: application/http 
Content-ID: 1 
POST [Organization URI]/api/data/v9.1/{{schemaname}} HTTP/1.1 
Content-Type: application/json;type=entry 


Content-Type: application/http 
Content-ID: 2 
POST [Organization URI]/api/data/v9.1/{{schemaname}} HTTP/1.1 Content-Type: application/json;type=entry 


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s