web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id : eaNh7GLo/q/dNak9pA+97N
Power Automate - Power Automate Desktop
Unanswered

[Walkthrough] How to use Invoke Web Service with multipart/form-data in Power Automate Desktop

Like (1) ShareShare
ReportReport
Posted on 6 Jul 2021 14:18:15 by Microsoft Employee

Summary 

A common requirement when sending/receiving data is to use an existing service. However, calling an external API may require a specific configuration. In this post I will explain how to configure Power Automate Desktop to use a REST API as service using the Invoke Web Service action.

 

Prerequisites 

  1. Visual Studio 2019 with .NET cross-platform development workload 
  2. Postman 
  3. Power Automate Desktop 

 

Requirements 

The requirement for this walkthrough will be edit a profile information by submitting data using the following: 

URL 

[base-url]/profile/info 

Method 

POST 

Content type 

multipart/form-data 

Form data 

name, surname

 

Configuring the API

You can skip this step if the API that will be consumed is already configured. 

The first step is to make sure that the API method is configured correctly to allow receiving data into chunks. In ASP.NET Core this is done by adding the Consumes attribute to the publicly facing method, like so: 

 

[ApiController] 
[Route("[controller]")] 
public class ProfileController : ControllerBase 
{ 
	[HttpPost] 
	[Consumes("multipart/form-data")] 
	[Route("info")] 
	public async Task<IActionResult> PostInfoAsync() 
	{ 
		// Do work 
		return Ok(); 
	} 
} 

 

 

Testing the API method using Postman

You can make sure that you have configured the method correctly with Postman by setting the body to form-data and providing a list of keys and their corresponding values. This will useful later when you need to configure the Invoke Web Service action in Power Automate Desktop.

 JesusFMSFT_0-1625580469109.png

 

After you have provided the data, click on Send to submit the request to the service. You should receive a 200 OK response from the service if everything was configured correctly.  

Postman provides snippets of all kinds, but the one that you are interested in is HTTP. 

JesusFMSFT_1-1625580469106.png

 

 As you noticed, the snippet not only specifies in Content-Type the type of data that you want to submit, but also a boundary parameter. You need to include this as is in the Invoke Web Service action to work as expected. 

 

Calling API method using Power Automate Desktop 

After making sure that the API method works, the last step is to simply configure the action in Power Automate Desktop like so: 

 

JesusFMSFT_2-1625580469115.png

 

Encoding request body

One important step is to make sure that the option to encode the request body matches the configuration at the receiving end. 

Encoding a request body means that Power Automate Desktop will encode the entire body, including query-string values. If characters such as blanks and punctuation are passed in an HTTP stream, they might be misinterpreted at the receiving end. 

Enabling the Encode request body option in the Advanced section converts characters that are not allowed in a URL into character-entity equivalents. For example, when the characters < and > are embedded in a block of text to be transmitted, they are encoded as %3c and %3e respectively. 

JesusFMSFT_3-1625580469112.png

 

 

  • yoko2020 Profile Picture
    495 on 06 Jul 2021 at 22:19:36
    Re: [Walkthrough] How to use Invoke Web Service with multipart/form-data in Power Automate Desktop

    If using curl i can do that.

    What i ask is uploading files pure using only action  invoke web service.

    I am just hoping they can integrate this feature in that action.

    No need to use another solution when dealing with upload files.

     

     

     

     

  • tkuehara Profile Picture
    667 on 06 Jul 2021 at 22:14:31
    Re: [Walkthrough] How to use Invoke Web Service with multipart/form-data in Power Automate Desktop

    Hi @yoko2020 

     

    I guess this is gonna depend on the API you're currently using but here is an example from a project I'm working at:

    First, I send a request to signalize to the API that I'm gonna send a file to it. If successful, the API returns the URL I must send the file to:

    tkuehara_0-1625607316067.png

    Second, I upload the file to the URL using curl:

    tkuehara_1-1625607443245.png

    tkuehara_2-1625607509940.png

     

  • yoko2020 Profile Picture
    495 on 06 Jul 2021 at 19:49:00
    Re: [Walkthrough] How to use Invoke Web Service with multipart/form-data in Power Automate Desktop

    Show us example to upload files using invoke web service.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 2

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 2

Loading complete