LowCodeStacks™
Sign in

Files and attachments in flows: email attachments, Forms uploads and list attachments to SharePoint

Save email attachments, Microsoft Forms uploads and SharePoint list attachments into a library folder. The trigger settings that matter, how to skip signature images, why .msg attachments don't show up, and the fixes for empty files and 400 Bad Request.

Power AutomateFix a problem7 min read

Checked against Microsoft Learn 6 sources · Updated By · drafted with AI help, checked by a personHow we write guides

Most file flows, such as saving email attachments to SharePoint, come down to the same move: get a file's name and content from one place, and create a file with them somewhere else. The tricky part is getting the content, which differs by source. Here are the three sources people ask about most.

Three sources of files, each ending in the same Create file step. Email attachments: the trigger When a new email arrives (V3), with Include Attachments set to Yes in the trigger's advanced settings, because with No the content is empty; a Filter array keeps items where isInline is false; then Apply to each attachment passes its Name and its Content. Microsoft Forms uploads: the trigger When a new response is submitted; Get response details for the same form; Parse JSON, because the upload answer is text containing JSON; then Apply to each file runs Get file content (OneDrive for Business) with its id. SharePoint list attachments: Get attachments returns names and file identifiers; then Apply to each attachment runs Get attachment content, using the File identifier. All three lead to SharePoint Create file, which needs a folder path, a file name with its extension, and the file content itself, not a link. If the content is empty, Create file fails, usually with 400 Bad Request.
How email attachments, Forms uploads and SharePoint list attachments each get their content to the same Create file step.

The pattern

Every "save it somewhere" action, such as SharePoint Create file or OneDrive Create file, needs:

  • a folder path;
  • a file name, including its extension;
  • the file content itself, not a link to the file.

If the content is empty, the action fails, usually with 400 Bad Request. Most of the fixes below are about making sure the content is really there.

1. Email attachments to a SharePoint folder

  1. Trigger: When a new email arrives (V3), or When a new email arrives in a shared mailbox (V2).
  2. In the trigger's advanced settings:
    • Include Attachments: Yes. This is the important one. With No, the trigger still lists the attachments' names, but their content is empty, and Create file fails with 400 Bad Request.
    • Only with Attachments: Yes, if the flow is only about attachments.
  3. Add Apply to each over the trigger's Attachments.
  4. Inside it, add SharePoint Create file:
    • File Name: the attachment's Name;
    • File Content: the attachment's Content.

If you start the flow from Create > Automated cloud flow, this is where you pick the trigger. What the dialog's trigger list shows, as of September 2026:

  1. Flow name: the name you give the flow, here Save invoice attachments.
  2. Choose your flow's trigger: type when a new email arrives to narrow the list.
  3. When a new email arrives (V3), from Office 365 Outlook: select this one, not the look-alike from Outlook.com. The shared mailbox version, When a new email arrives in a share…, is lower in the list.
  4. Create: opens the designer with the trigger in place, ready for step 2.
The right-hand part of the Build an automated cloud flow dialog in Power Automate. Flow name is Save invoice attachments. Under Choose your flow's trigger, marked required, the hint reads Search or select a trigger from the list below to create a flow, and the search box contains when a new email arrives. Five results follow, each with its connector icon and an info icon: When a new email arrives (V2) from Outlook.com; When a new email arrives (V3) from Office 365 Outlook, selected and checked; When a new email mentioning me ar… from Outlook.com; the same from Office 365 Outlook; and When a new email arrives in a share… from Office 365 Outlook. At the bottom are the buttons Skip, Create and Cancel.
Recreated by LowCodeStacks from Microsoft Learn screenshots (CC BY 4.0): the trigger list in Power Automate's Build an automated cloud flow dialog, interface as of September 2026, with a made-up flow name.

Skip signature images

Logos and images in email signatures are attachments too, marked Is Inline. To save only real attachments, put a Filter array before the loop: keep items where isInline is equal to false. Then loop over the filtered list.

text
@equals(item()?['isInline'], false)

Avoid name clashes

Two emails can both carry invoice.pdf. Make each name unique, for example by putting the received date in front:

text
concat(formatDateTime(triggerOutputs()?['body/receivedDateTime'], 'yyyyMMdd-HHmmss'), '-', items('Apply_to_each')?['name'])

Limits

  • The email triggers skip any email larger than 50 MB, or your Exchange admin's limit if that's lower. They can also skip protected emails.
  • The connector handles at most 49 MB of email content.

2. Emails attached to emails (.msg, .eml) and invitations (.ics)

An email or meeting attached to another email is an item attachment, not a file. The Office 365 Outlook connector doesn't return item attachments: the trigger shows the email has an attachment, but the list is empty.

Your options:

  • Ask senders to zip them. EML, MSG and ICS files inside a .zip come through as normal file attachments.
  • Save the whole email instead with Export email (V2), which returns the email as an .eml file you can save with Create file.
  • Use Microsoft Graph through the HTTP with Microsoft Entra ID connector to read item attachments. This is for experienced makers; see Microsoft's connector notes.

3. Microsoft Forms uploads to a SharePoint folder

A Forms file-upload answer isn't a file. It's text containing JSON that describes the uploaded files: their name, link and ID.

  1. Trigger: When a new response is submitted. Then add Get response details for the same form.
  2. Submit one test response with a file, open the run, and copy the upload question's output.
  3. Add Parse JSON. For Content, choose the upload question's answer, select Generate from sample, and paste what you copied.
  4. Add Apply to each over the Parse JSON body, because one question can accept several files.
  5. Inside it:
    • Get file content (OneDrive for Business) with the file's id;
    • SharePoint Create file with the file's name and the content from step 5's first action.

Tip

Only want the first file? Skip the loop and use first(body('Parse_JSON'))?['id'], the expression Microsoft's own Forms example uses.

4. SharePoint list item attachments to a library

List attachments need two calls:

  1. Get attachments for the item. This returns a list of names and file identifiers.
  2. Apply to each attachment:
    • Get attachment content, using the File identifier;
    • Create file with the attachment's name and that content.

Going the other way, Add attachment puts a file onto a list item.

When it goes wrong

SymptomLikely causeFix
400 Bad Request on Create file, with an email triggerInclude Attachments is No, so the content is emptySet it to Yes
Created files are 0 bytes or won't openYou passed a link, an ID or text instead of the file contentPass the Content output of a "get content" action
400 Bad Request with a strange file nameThe name contains characters SharePoint doesn't allowClean the name with replace() before Create file
.msg or .eml attachments missingItem attachments aren't returned by the connectorZip them, export the email, or use Graph (section 2)
Some emails never trigger the flowOver 50 MB, or protectedCheck the message size and protection
An approval rejects the attachmentApproval attachments need base64 contentMost file actions already return it; for your own text, use base64()

Sources

Add LowCodeStacks as a preferred source on Google

Did this fix it?

Get the weekly email

New guides and updates from LowCodeStacks, every Tuesday. One email a week, no more.

From LowCodeStacks, Regina, SK, contact@lowcodestacks.com. You can unsubscribe any time, from the link in every email or in your privacy settings. See the Privacy notice.

Comments

No comments yet. Share what worked for you.

Sign in to comment. Comments show under a display name you choose, never your email.