Skip to content
Tutorials Center
My learning

Topics

Lesson 3 of 38 ยท Getting Started

Your First Power Automate Cloud Flow, Step by Step

Create your first cloud flow from a blank canvas: pick a trigger, add actions, use dynamic content, save and run it, with a stand-in that simulates the steps.

In this lesson you build a small useful flow: when a message with an attachment arrives in a mailbox, the file is saved to OneDrive and you get a Teams message. The steps use only standard connectors. Menu names can shift slightly between releases, so look for the described label rather than the exact position.

Before you start

You need a work or school Microsoft 365 account with Power Automate access. Open make.powerautomate.com and sign in. The left navigation holds Home, Create, Templates, Learn, My flows, Approvals and Solutions (some items sit under More). The environment picker at the top right should show your default environment (see Environments and solutions).

Step 1: create the flow

  1. Select Create in the left navigation.
  2. Under Start from blank, choose Automated cloud flow.
  3. Name it Save invoice attachments.
  4. In the trigger search box type new email, pick When a new email arrives (V3) from the Office 365 Outlook connector and select Create.

If a connection does not exist yet, the designer asks you to sign in. That creates a connection, the stored login the flow uses (more in Connections and authentication).

Step 2: tune the trigger

The trigger card has parameters. Open Advanced parameters (shown as a drop-down link) and set:

  • Folder: Inbox
  • Only with Attachments: Yes
  • Include Attachments: Yes
  • Subject Filter: Invoice

Setting filters on the trigger is better than filtering later, because the flow does not even start for mail that does not match. That also saves runs.

Step 3: add an action

  1. Select + New step (or the plus sign between cards) and Add an action.
  2. Search create file and choose Create file from OneDrive for Business.
  3. Folder Path: pick a folder such as /Invoices with the folder icon.
  4. File Name: click in the box; a panel with dynamic content opens. Choose Attachments Name.
  5. File Content: choose Attachments Content.

The designer wraps the action in an Apply to each loop automatically, because an email can have several attachments and Attachments is a list. The loop runs the action once per attachment.

Step 4: notify the team

Add another action inside the loop or after it: Post message in a chat or channel from Microsoft Teams. Choose Post as: Flow bot, Post in: Channel, pick the team and channel, and write a message that mixes text with dynamic content, for example:

New invoice file saved: followed by the dynamic content Attachments Name.

Step 5: save and test

  1. Select Save.
  2. Select Test, choose Manually, then Test. Send yourself an email with a PDF and the word Invoice in the subject.
  3. The designer shows each card with a green check mark or a red cross. Select a card to see its inputs and outputs.

If a step fails, read the error message at the top of the card; the usual causes are an invalid path or an expired connection.

What the flow looks like as data

Behind the designer, a flow is stored as JSON. You can export it and read it. The stand-in below uses a small Python dictionary with the same logical shape, labelled clearly as invented, to show the structure: one trigger, a loop and actions that use the trigger output.

Python Stand-in: simulate the flow with a sample email

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The loop in the code is the same thing as the Apply to each card.

Make it more robust

A first version works on the happy path. Improve it with small steps:

  • Add a Condition that checks the file name ends with .pdf before saving (see Expressions first steps).
  • Rename each card (select the three dots, then Rename). Names such as Save PDF to Invoices make run history readable.
  • Add a Scope around the actions and a second scope for failures (chapter 7).

Here is the same filter written as a helper, so you can see what a condition decides.

Python Stand-in: keep only PDF attachments

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Common mistakes

  • Leaving the default flow name like Untitled. You will not find it in a list of 40 flows later.
  • Filtering on the subject inside the flow only. Use the trigger filters first.
  • Testing with emails that do not match the filter, then thinking the flow is broken. The run history simply shows no run.
  • Building the loop yourself when the designer already added one.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Why does the designer add an Apply to each loop around Create file?

    An email can have several attachments, so the list is processed one item at a time.
  2. 2. Where is it best to filter on a subject word?

    Trigger filters stop non-matching items from starting a run at all.
  3. 3. What does a connection store?

    A connection holds the credentials or token used by actions of that connector.
  4. 4. After saving, which button runs a first manual test?

    Test lets you trigger the flow manually or with a sample and shows every step's result.

Summary

  • Create an automated cloud flow, choose the trigger and set its filters.
  • Add actions and fill their fields with dynamic content.
  • The designer wraps list values in Apply to each automatically.
  • Save, test, and inspect each card's inputs and outputs.

Next: The designer, testing and run history