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 only pdf files fr...
Power Automate
Answered

Save only pdf files from email to Sharepoint

(1) ShareShare
ReportReport
Posted on by 159
Hello Team.
 
I am working on a Power Automate flow where the main trigger is when an email with an attachment is received and I want that if that attachment is a file in PDF format it is saved on my Sharepoint site. I have read several tutorials but I can only find the solution to save all the files in the email, that is, if the email arrives with a PDF and an image with the sender's signature or their company logo, these images are also saved. I would only like to save the PDF file. Is this possible?
Categories:
I have the same question (0)
  • Suggested answer
    trice602 Profile Picture
    16,138 Super User 2026 Season 1 on at
    Hi,
     
    Here's a flow you can use.  Please check it out!
     
    In the trigger, it is important to turn on both parameters to Yes.
     
     
    Next add a condition. You do not need to add the Foreach; it will add itself.  I like to create flows this way to make sure I am using the correct dynamic content in my loop.  So here, we check if the attachment name is a pdf.  If true, create the file.  This will help you eliminate those pesky signature pngs.
     
     
    Next, on the true side, I create the file in SharePoint.
     
     
    ------------------------------------------------


    If this was helpful, please like and/or mark as a verified answer to help others find this too!


    Always glad to help! 💯💯💯💯💯

    Tom 

    Follow me on LinkedIn - Thomas Rice, PMP | LinkedIn

     


     
  • Suggested answer
    trice602 Profile Picture
    16,138 Super User 2026 Season 1 on at
    Hi,
     
    I also wanted to show you the run and the results.  Here's the sample email with two attachments, one pdf and one png.
     
     
    The first attachment is processed and saved to SP, shown below.
     
     
     
     
    The second attachment is was not saved because it was a png.
     
     
     
    ------------------------------------------------


    If this was helpful, please like and/or mark as a verified answer to help others find this too!


    Always glad to help! 💯💯💯💯💯

    Tom 

    Follow me on LinkedIn - Thomas Rice, PMP | LinkedIn

     


     
     
     
  • Verified answer
    Mark Nanneman Profile Picture
    993 Moderator on at
    You can filter the attachments array on the contentType or name property.  Checking if the value contains "pdf" would filter only pdfs from the attachments array.




    use a filter operation to output only the items from the attachments array that contain "pdf" in the "contentType" property:



    Example:

     
    After this just do a apply to each on the output of the filter action to save your files or do whatever you want with them.
     
    If this helped you, please click "Does this answer your question" and give it a like to help others in the community (+ close the ticket)!

    Power Platform Developer | LinkedIn: Mark Nanneman | Blog: Power Stuff  | YouTube: Mark's Power Stuff 


     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 598

#2
Valantis Profile Picture

Valantis 477

#3
Vish WR Profile Picture

Vish WR 370

Last 30 days Overall leaderboard