cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
marcelofabiansc
Regular Visitor

Custom connector with multipart/form-data with two headers

I'm trying to use a HTTP Request in a custom connector, but I can't because It seems like the custom connector can't manage two bodys and headers in multipart/form-data and with a request HTTP , does work well. Anybody can tell me how can I make it?

This is my Request HTTP:

marcelofabiansc_0-1627473314171.png


When I make the custom connector with Import with sample

appears like this :

marcelofabiansc_1-1627473393664.png


Some help to make this done?
Thanks in advance.





 

6 REPLIES 6
cchannon
Solution Sage
Solution Sage

Check the sample JSON you feed the custom connector. I think maybe you missed the square brackets denoting the list of objects. When you give it a JSON list, the power automate experience should be similar to what you describe, but there will also be an Add Item button that you can use to add additional rows to the list.

Here's an example:

 

I create a new custom connector hitting abc.123.com/test, and I am going to send it a POST with the body: 

{
	"content":[
		{
			"myobj":1
		},
		{
			"myobj":2
		}
	]
}

and now when I publish this and add it as an Action in my flow: 

cchannon_0-1627735681154.png

I can add an arbitrary number of items to this list by just clicking "Add new item", or I can click the little "switch to input" icon in the upper right to get a raw JSON body input option:

cchannon_1-1627735745897.png

 

Hi @cchannon , thnaks for your solution, but the thing is that if I put, following your example "two contents" , the custom connector just recognize one of them. That's what happening with the two headers and the two body I have , see the image in the beggining of the post.

Again, if you are not getting the "add new item" option in your flow, something about your JSON is causing the custom connector to not realize that $multipart is a list. NOTE: in the Test screen in the custom connector, it will not give you an Add New. You will need to test it with a one-member list, then add it to a flow to actually test a multiple-member list.

It appears, but the body from file doesn't

marcelofabiansc_0-1627910340634.png

 

Give it a simpler example for body that doesn't include those optional transalateto/translatefrom strings, then use the little icon in the upper right to feed it anything you want in the form of raw json.

cchannon_0-1627912245415.png

 

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (2,497)