All insights
AutomateMicrosoft 365How-To Guide

Build your first Power Automate flow: auto-file incoming documents to SharePoint and notify the team

Build a no-code flow that watches a shared inbox, files every attachment into SharePoint with a clean name, and posts to Teams.

Wired CIOJune 21, 2026
The short version
  • Trigger on a new email with an attachment arriving in a shared mailbox.
  • Loop the attachments and create each file in SharePoint with a dynamic, dated folder and name.
  • Post a Teams message so the team sees what landed, and add a failure alert.
  • Test manually, then watch the run history for a week and tune for real-world curveballs.
Bottom line: One watch-sort-file-notify flow is the backbone pattern that makes your next ten automations easy.

If your team emails documents to a shared inbox (invoices, signed forms, packing slips) and someone drags each one into SharePoint by hand, this guide is for you. By the end you'll have a working Power Automate flow that watches that inbox, files every attachment into the right folder with a consistent name, and drops a note in Teams so everyone knows it landed. No code, about an hour.

Power Automate is Microsoft's workflow tool, included with most Microsoft 365 plans for standard flows.

Before you start

  • A shared mailbox the documents arrive in (for example, invoices@yourcompany.com). Use a shared or resource mailbox, never a person's personal inbox.
  • A SharePoint document library to file into, and Edit access to it.
  • A Teams channel for the notification.
  • The Power Automate app at make.powerautomate.com, signed in with your work account.

Step 1: Sketch the flow before you build it

On paper, write three things: the trigger ("a new email with an attachment arrives in invoices@"), the action ("save each attachment to SharePoint under /Invoices/2026-06/"), and the notification ("post to the Finance Teams channel"). Decide your folder structure and a file-naming convention now, for example YYYY-MM-DD_Sender_Subject.pdf. Getting this clear on paper saves you rebuilding later.

How the document-filing flow runs WHEN New email with an attachment arrives in the shared mailbox Apply to each attachment DO Create file in SharePoint Dated name, foldered by month on failure CATCH Send you an alert THEN Post a message to Teams So the team sees it landed
The whole flow on one page: trigger, loop, file, notify — with a failure branch.

Step 2: Create the flow

  1. Go to make.powerautomate.com, select Create, then Automated cloud flow.
  2. Name it something obvious like "File invoices from shared inbox."
  3. For the trigger, search "When a new email arrives in a shared mailbox (V2)" and select it.

Step 3: Configure the trigger

  • Original Mailbox Address: invoices@yourcompany.com
  • Folder: Inbox
  • Open Advanced options and set Only with Attachments to Yes and Include Attachments to Yes.

Step 4: Loop through the attachments

  1. Add a new step, Apply to each, and point it at the trigger's Attachments field. Power Automate will loop once per attachment.
  2. Inside the loop, add Create file (SharePoint connector).
    • Site Address: your SharePoint site.
    • Folder Path: build it dynamically so files self-sort by month. Type /Invoices/ then add an expression for the year-month: formatDateTime(utcNow(),'yyyy-MM'). The result is /Invoices/2026-06.
    • File Name: combine dynamic content for a clean, sortable name, for example formatDateTime(utcNow(),'yyyy-MM-dd') then _ then the Attachments Name.
    • File Content: the Attachments Content field.
Mind the file path

SharePoint rejects file paths longer than about 400 characters and a handful of characters like # % * : < > ? /. Keep names short and strip odd characters from the subject if you use it.

Step 5: Notify the team

After the loop, add Post message in a chat or channel (Teams connector). Pick your Team and channel, and write a message that pulls in the email subject and sender, for example: "New document filed from {From}: {Subject}." For something nicer, use Post adaptive card instead of a plain message.

Step 6: Add error handling

You don't want a silent failure. Add one more Post message step to a private channel or to yourself, and set its Run after (the three-dots menu, "Configure run after") to run only "has failed" on the Create file step. Now if filing breaks, you hear about it.

Step 7: Test it

  1. Select Save, then Test, then Manually.
  2. Send a test email with a PDF to invoices@.
  3. Watch the run light up green, then check SharePoint for the file and Teams for the message.
  4. If a step is red, open it, read the error, fix it (usually a wrong field or a permissions issue), and re-test.

Step 8: Turn it on and watch it for a week

Leave it on, and check the Run history for the first several days. Real inboxes throw curveballs (forwarded mail, inline images counted as attachments, zip files), and you'll tune the flow as they show up.

One flow, then ten

This exact shape (watch, sort, file, notify) is the backbone of dozens of automations. Once it clicks, you can route signed contracts, log submissions to a SharePoint list, or kick off an approval. Build this one, and the next ten get easier.

Where to take it next

With one flow under your belt, the next step is the handful of patterns that cover most requests: approvals, scheduled reports, reminders, and form intake. If you want help picking the first automation that'll save your team real time, let's talk it through.

Filed under
How-To Guide
Read more insights
Free strategy session

See where you stand. Then move forward.

Book a free intro call. We'll talk through where you are today and map a strategic plan for growth, protection, automation, and alignment.

A 30-minute discovery call, no obligationA full team of specialists at a fraction of in-house costA clear next step before you spend a dollar
Loading scheduler…