šŸŽÆ Build Your First Flow in Power Automate (Step-by-Step, with Example) | DAY-3

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

  1. Visit make.powerautomate.com
  2. Left menu → Create
  3. 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)

  1. Click + New step
  2. Search Apply to each
  3. 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

  1. Inside Apply to each, click Add an action
  2. Choose OneDrive for Business → Create file
  3. 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)

🧠 Why Content bytes? That’s the actual file content of the attachment.

(Optional) Step 6: Post a Teams notification

  1. Still inside the loop, click Add an action
  2. Choose Microsoft Teams → Post a message in a chat or channel
  3. 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} or Report_{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
  • 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

  1. Trigger: Microsoft Forms → When a new response is submitted
  2. Action: Forms → Get response details
  3. Action: Teams → Post a message in a channel (share key answers)
  4. 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.


Discover more from Quickinfoz

Subscribe to get the latest posts sent to your email.

Leave a Reply

Your email address will not be published. Required fields are marked *

Discover more from Quickinfoz

Subscribe now to keep reading and get access to the full archive.

Continue reading