Skip to main content

Notifications

Community site session details

Community site session details

Session Id : 6/YyLX3e/3aEQIUrDYbKc9
Power Automate - Building Flows
Answered

How to setup Flow to download attachment from Outlook from one sender with 3 different email files

Like (0) ShareShare
ReportReport
Posted on 20 Jun 2023 16:16:18 by

Hello gurus,

 

I am hoping you can assist me with this flow setup.

 

I received 3 daily emails with attachments from the same email address via Outlook. Each email has its own email subject, but its the same every day. The only difference is the file attached. How do i set up a flow that can differentiate those 3 emails and download and save the file and replace the previous days file?

 

I have a flow that does similar things but is for one condition. Example:  Received email from send X, condition contains "XXXX", If yes add action, if no, add action.  But there are 3 conditions and that is where i am stuck. Not sure how to add multiple conditions or do i have to make a flow for each type?

 

thank you,

 

  • Ellis Karim Profile Picture
    10,927 Super User 2025 Season 1 on 23 Jun 2023 at 15:18:10
    Re: How to setup Flow to download attachment from Outlook from one sender with 3 different email files

    Yes, the flow will run automatically.  Check your trigger conditions if you are not used to using trigger conditions.

     

    I would suggest:

     

    (1) Get the flow working first without trigger conditions. That way you can view the properties of each actions after runtime (e.g.. you view the values for the FROM property and the Subject Line  property). You can check if conditions are affected by uppercase or lowercase text in the subject line etc).  Let the flow run for a few days, ensuring that the flow has run a number of times to ensure that it is working reliably.

     

    (2) Refine the flow to use trigger conditions (but this is optional). Trigger conditions ensure that the flow only triggers if the conditions are met, but can make the initial fault finding process more difficult (e.g. why didn't the flow trigger?).

     

    For either case (1) or (2) above,  you can view the values of the From and Subject line after run time by selecting these column to be displayed in the runtime history:

    ekarim2020_1-1687533142678.png

     

     

    ekarim2020_3-1687533251244.png

     

    ekarim2020_2-1687533213427.png

     

    ekarim2020_4-1687533468942.png

     

    In this example I selected the Has Attachment property to be shown:

    Snag_69c85a5.png

     

    Hope this helps.


    Ellis
    ____________________________________
    If I have answered your question, please mark the post as ☑️ Solved.
    If you like my response, please give it a Thumbs Up.
    My Blog Site

     

     

  • punksterz626 Profile Picture
    on 23 Jun 2023 at 14:47:28
    Re: How to setup Flow to download attachment from Outlook from one sender with 3 different email files

    Hi. Does this flow run automatically? I notice it didnt catch today's email. It worked when i test it yesterday. 

  • punksterz626 Profile Picture
    on 22 Jun 2023 at 19:32:22
    Re: How to setup Flow to download attachment from Outlook from one sender with 3 different email files

    thank you so much for the detail walkthrough. It works flawlessly. 

  • Verified answer
    Ellis Karim Profile Picture
    10,927 Super User 2025 Season 1 on 20 Jun 2023 at 22:45:56
    Re: How to setup Flow to download attachment from Outlook from one sender with 3 different email files

    Hi @punksterz626 ,

     

    You could try a trigger condition. The flow will only run if the trigger conditions are met. In your case you can test for the three different subject lines.

     

    Here is an example.

     

    (1) Click the ellipsis (the three dots), (2) then select Settings:

    Snag_570e740.png

    (3) Click Add to add a trigger condition:

    ekarim2020_1-1687300468091.png

     

    (4) Copy the following expression to the trigger condition:

     

    @or(equals(triggerOutputs()?['body/subject'],'Subject 1'), equals(triggerOutputs()?['body/subject'],'Subject 2'), equals(triggerOutputs()?['body/subject'],'Subject 3'))

     

     

    ekarim2020_2-1687300560694.png

     

    Here is the same expression displayed for easy reading. Change the subject text to match your requirements:

    Snag_56d0105.png

    You could also add other trigger conditions as needed, for example FROM:

    Snag_57cb0b5.png

     

    @equals(triggerOutputs()?['body/from'],'ellis.karim@365.com')

     

     

    Now the flow will only trigger if all of the conditions are met.

     

    Finally, you can use the Switch action to take different actions depending on the text of the subject line:

    ekarim2020_0-1687339313487.png

     

    The default can be used to handle the condition where there is no match in any of the Case conditions (i.e. this will handle Subject 3 in our example):

     

    Snag_7b43253.png


    Ellis
    ____________________________________
    If I have answered your question, please mark the post as ☑️ Solved.
    If you like my response, please give it a Thumbs Up.
    My Blog Site

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,700 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,015 Most Valuable Professional

Leaderboard
Loading started