Hi All,
I am having a bit of trouble with sending a multipart form through a http request. I have been able to get it to succussed but the problem i have now is that i need to format of the uploaded file to to look something like this with an array called source:
{"source":[
{"k": "File name",
"v": "Some Value"},
{"k": "document size",
"v": "Some Other value"}]}
currently this is my request and i'm not sure how to change:
{
"$content-type": "multipart/form-data",
"$multipart": [
{
"headers": {
"Content-Disposition": "form-data; name=\"country\""
},
"body": "UK"
},
{
"headers": {
"Content-Disposition": "form-data; name=\"department\""
},
"body": "finance"
},
{
"headers": {
"Content-Disposition": "form-data; name=\"source_url\""
},
"body": "@{items('Apply_to_each')?['LinkToItem']}"
},
{
"headers": {
"Content-Disposition": "form-data; name=\"confidentiality\""
},
"body": "Private"
},
{
"headers": {
"Content-Disposition": "form-data; name=\"uploaded_file\"; filename=\"@{items('Apply_to_each')?['{FilenameWithExtension}']}\""
},
"body": @{outputs('FileContent')}
}
]
}
Any help is appreciated. Thank you in advance
Hi @ManishSolanki,
Thank you for taking the time to respond. I did come across you post when building out the original request which was most useful! However, with the change of requirement as mentioned above i am unsure how to best restructure the main body to allow for the array for the file uploaded.
Pls check out my blog where I have explained the steps to send multipart form request:
Post multipart form/data using http connector in power automate (manish-solanki.com)
If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.
Tomac
986
Moderator
stampcoin
699
Super User 2025 Season 2
Riyaz_riz11
577
Super User 2025 Season 2