web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Save attachement using...
Power Automate
Answered

Save attachement using conditions

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello Everyone,

I am working on a flow that allows me to receive attachments from a generic mailbox and transmit them to a SharePoint.
My need is when I receive an email with an attachment in the generic mailbox and it's an Excel file with a PDF file. I don't want any of the attachments to be processed and I want to receive an email with both attachments immediately.
However, if I receive only PDF files in the mail, in this case I want it to be processed and Added to the SharePoint Library.

that’s what i need but i don’t know how to express it ( IF Mail CONTAINS both attachement PDF and EXCEL so send email to me , but IF mail CONTAINS ONLY pdf then create file in SHAREPOINT)

Thank you for your help.

 

  1. Capture&.PNG
Categories:
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at
  • Mister_Shaik Profile Picture
    1,008 on at

    Hi @Anonymous ,

     

    You can split the logic as below,

    1. Trigger only when attachments are present in incoming email and include attachments
    2. Collect all attachment names into a string array
    3. Check if string array contains both excel and pdf
    4. For Yes - send attachments to yourself
    5. For No - iterate each attachment and save in SharePoint lib

    1 trigger.PNG2 select and condition.PNG3. condition.PNG

     

    You might notice that for checking excel I'm using a condition group - as excels have different extensions.

     

    Hope this helps 🙂


    Kind Regards,

    Shaik Sha
    ________________________________________________________________________
    If I have answered your question, please mark the post as Solved.
    If you like my response, please give it a Thumbs Up.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hello @Mister_Shaik , First of all Thank you very much for your answer , i just tried to send 2 attachements one PDF and the other one Xlsx , but in final it doesn't take in consideration the conditions and here is the resukt of the flow

    Capturee.PNG

    Normally in this case it should be true 

  • Verified answer
    Mister_Shaik Profile Picture
    1,008 on at

    Hi @Anonymous ,

     

    Small correction in the conditions, rather than passing the entire array to check the contains expression, we have to join the strings in array and then do the contains check.

     

    You can replace the outputs with this expression,

    join(outputs('Select'),' ')

     

    Mister_Shaik_0-1647342314125.png

    Kind Regards,

    Shaik Sha
    ________________________________________________________________________
    If I have answered your question, please mark the post as Solved.
    If you like my response, please give it a Thumbs Up.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @Mister_Shaik , Thank you very much for you help , i just tried it and it works now  

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 321 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 244

#3
Henil Profile Picture

Henil 102

Last 30 days Overall leaderboard