Goal:
I want to create a Power Automate flow that:
- Triggers when a new email arrives in a shared mailbox (including attachments).
- Loops through each attachment and checks if the file extension is
.xlsx.
- Sends the file in a POST request to an API that works correctly when tested in Postman.
Problem:
Even though my email trigger has "Include Attachments" enabled, I cannot correctly send the file content in the HTTP POST request. My API either rejects the file or does not receive it in the correct format.
Current Setup:
- Trigger: "When a new email arrives (V3)"
- ✅ Include Attachments: Yes
- Apply to each (Attachments)
- Condition:
Attachments Name ends with .xlsx
- HTTP POST Request (multipart/form-data):
What I've Tried:
- ✅ Confirmed my API works in Postman (it correctly processes
.xlsx files).
- ✅ Copied the request body sent through the postman call (except for dynamic content of course)
- ✅ Checked that attachments are included in the trigger.
- ❌ No matter how I format the request, the API either does not receive the file correctly and returns nothing to process as it could not read it.
Question:
- How should I correctly format the HTTP request body in Power Automate to send the
.xlsx file as a valid multipart/form-data attachment?
- More specifically, what should be the value of $content ?
- Do I need to manually convert the file to base64 or send it as raw binary?
Thanks in advance for any help!