In Day 1 you learned the What/Why/Where/When of Power Automate, and in Day 2 you met Connectors & Triggers.
Today weâll build your first working automationâno code needed.
Weâll create this real-life flow:
Scenario: Save every email attachment with âReportâ in the subject to a specific OneDrive folderâautomatically.
â Prerequisites
- Microsoft 365 account with Outlook and OneDrive for Business
- Access to Power Automate: go to
make.powerautomate.com
- A OneDrive folder created for saved files (e.g.,
/Reports
)
đ§ What weâre building (at a glance)
[Trigger: When a new email arrives]
â (only with attachments + subject contains âReportâ)
âŒ
[Loop over each attachment]
âŒ
[Create file in OneDrive /Reports/âŠ]
âŒ
[Optional: Teams notification or mark email as read]
đ ïž Step-by-Step: Create the Flow
Step 1: Open Power Automate
- Visit make.powerautomate.com
- Left menu â Create
- Choose Automated cloud flow
Step 2: Name & Choose Trigger
- Flow name:
Save Report Attachments to OneDrive
- Trigger: Search Outlook â select When a new email arrives (V3) â Create
Step 3: Configure the Trigger
In the trigger card, set:
- Folder:
Inbox
(or a subfolder if needed) - Include Attachments:
Yes
- Only with Attachments:
Yes
- Subject Filter:
Report
(or âSales Reportâ, âInvoiceâ, etc.)
đĄ Tip: Using âOnly with Attachments = Yesâ prevents the flow from running on emails with no files.
Step 4: Add âApply to eachâ (loop over attachments)
- Click + New step
- Search Apply to each
- In Select an output from previous steps, choose Attachments (from the triggerâs dynamic content)
This tells the flow to run the next steps for each attachment found in the email.
Step 5: Inside the loop â Create the file in OneDrive
- Inside Apply to each, click Add an action
- Choose OneDrive for Business â Create file
- Configure:
- Folder Path:
/Reports
(or browse to your folder) - File Name: Click in the field and insert Name (from the attachment)
- File Content: Insert Content bytes (from the attachment)
- Folder Path:
đ§ Why Content bytes? Thatâs the actual file content of the attachment.
(Optional) Step 6: Post a Teams notification
- Still inside the loop, click Add an action
- Choose Microsoft Teams â Post a message in a chat or channel
- Set:
- Post as: Flow bot
- Post in: Channel
- Team/Channel: Choose your team & channel
- Message:
Saved: @{items('Apply_to_each')?['name']} from @{triggerOutputs()?['body/from']} to /Reports
đŻ This gives you instant visibility that a file was saved.
Step 7: Save & Test
- Click Save (top-right)
- Click Test â Manually
- Send yourself an email:
- Subject contains âReportâ
- At least one attachment
- Return to flow run â Run history to see success/fail and outputs
đ§Ș Verify It Worked
- Open OneDrive â /Reports
- The attachment(s) should appear with the same file name
- If you enabled Teams notification, check the message in your channel
đ§° Common Pitfalls & Fixes
- Flow didnât trigger?
- Subject didnât match your Subject Filter exactly
- Email didnât land in the Inbox folder you selected
- Only with attachments is Yes, but the email had no files
- File name errors (invalid characters)?
- Rare, but if a subject or name introduces invalid characters, keep File Name as the original Name dynamic value (thatâs safest).
- If you really need custom naming, keep it simple (e.g.,
{Name}
orReport_{utcNow()}.xlsx
).
- Large or many attachments:
- Start small. If you often get huge files, consider adding a Condition step to skip files above a size threshold (available as dynamic content in some connectors) or run the flow less frequently with rules in Outlook.
đ§© Variations You Can Try
Variation A: Move email after saving files
- After the OneDrive action, add Outlook â Move email (V2)
- Message Id: from the trigger
- Destination folder: e.g.,
/Processed/Reports
Keeps your Inbox cleanâautomation + tidy mail = đ
Variation B: Add a timestamp to file names
- In File Name, combine dynamic content:
@{utcNow()}_@{items('Apply_to_each')?['name']}
- Result:
2025-09-01T08:30:00Z_Report.xlsx
Variation C: Send approval if file is from a VIP sender
- Add a Condition after the trigger:
- If From equals
manager@contoso.com
â start Approvals â Start and wait for an approval
- If From equals
- Else â just save to OneDrive
đ§ Pro Tips (Beginner-friendly)
- Start with Templates: In Power Automate, go to Templates and search âsave email attachmentsââcustomize from there.
- Scope your trigger: Use Subject Filter / From to avoid unnecessary runs.
- Add a safety Condition: If Attachments length is
0
, Terminate (just in case). - Monitor run history: Red = failed, Grey = skipped, Green = success. Click into any run to see inputs/outputs per action.
- Name your actions clearly: e.g., âCreate OneDrive file â Attachmentâ (helps a lot when debugging later).
đ Bonus: A Second Beginner Flow (5 minutes)
Forms â Teams + Excel log
- Trigger: Microsoft Forms â When a new response is submitted
- Action: Forms â Get response details
- Action: Teams â Post a message in a channel (share key answers)
- Action: Excel Online (Business) â Add a row into a table (store responses in a central log)
Perfect for simple surveys, feedback, or lead captureâsuper easy win.
â Wrap-Up
Youâve just built your first Power Automate flowâand proved to yourself that automation doesnât require coding.
From here on, youâll start spotting opportunities everywhere: âIf this happens â then do that.â
Next up: weâll explore flow best practices (variables, conditions, error handling, and performance tips) so your automations are clean, reliable, and scalable.