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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Save only pdf files fr...
Power Automate
Unanswered

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
    15,402 Super User 2025 Season 2 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
    15,402 Super User 2025 Season 2 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
    991 Super User 2025 Season 2 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard