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 / How to create a flow t...
Power Automate
Suggested Answer

How to create a flow that sends a PDF file via email when added to a SharePoint folder?

(0) ShareShare
ReportReport
Posted on by 33

I'm trying to build a Power Automate flow that triggers whenever a file is added to a specific SharePoint folder. The goal is: if the added file is a PDF, it should be sent as an email attachment.

So far, I’ve:

  • Created the trigger: “When a file is created in a folder” (SharePoint)
  • Added a condition to check if the file type is P
However, the flow doesn’t work as expected. No emails are sent, regardless of whether the uploaded file is a PDF, Excel, or Word document. There are no error messages or suggestions in the flow, it just silently fails. Has anyone successfully built a flow like this? Could you share how you structured it or suggest what I might be missing?

Thanks in advance!

 
Categories:
I have the same question (1)
  • chiaraalina Profile Picture
    1,860 Super User 2026 Season 1 on at
     

    In your condition you’re currently using something like:

     
    headers/x-ms-file-last-modified
    is equal
    to
    .pdf
     

    That’s not correct — this expression is checking a file header instead of the file name.

     

    Please try this instead:

     
    endsWith(triggerBody()?['{FilenameWithExtension}'], '.pdf')
     

    This expression correctly checks whether the uploaded file’s name ends with “.pdf”.

     

     

     

  • Suggested answer
    Inogic Profile Picture
    1,265 Moderator on at
    Hi,
     
    Please follow the steps below to create the flow:
    1. Trigger
    Use “When a file is created in a folder” (SharePoint).
    Ensure the folder path is correct (no trailing slashes) and the document library name is accurate.

    2. Get file metadata
    Add the “Get file metadata” action and pass the Identifier from the trigger.
    This allows you to reference the file’s name, extension, and path.

    3. Condition – Check if the file is a PDF
    Add a Condition action and use one of the following expressions to filter only PDF files:
    endsWith(triggerOutputs()?['body/{FilenameWithExtension}'], '.pdf')
    or
    equals(triggerOutputs()?['body/{File_x0020_Type}'], 'pdf')
    (The expression may vary depending on what the trigger returns — you can verify this from a test run.)
    4. Get file content
    In the If yes branch (for PDFs), add “Get file content” and use the Identifier from the trigger again.

    5. Send an email (V2)
    Add the “Send an email (V2)” action.
    • Attachments Name: use the file Name from the metadata step.
    • Attachments Content: use the output from Get file content.
    6. Test & verify permissions
    Make sure the flow owner has permission to access the SharePoint library.
    Upload a test PDF file to confirm that the flow triggers as expected.

    Hope this helps!
     
    Thanks!
    Inogic
  • DM-30101910-0 Profile Picture
    33 on at

    Thank you for the response!

    Hi @chiaraalina Unfortunately, I haven’t been able to figure out how to enter the description in the condition. I'm not writing any code—I'm only using Power Automate templates to create the flow.

    Is the expression supposed to be added in the section below? 

    to get the trigger, do you use When a file is created (properties only)?

    Thank you!!!

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!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 557

#2
Valantis Profile Picture

Valantis 328

#3
David_MA Profile Picture

David_MA 264 Super User 2026 Season 1

Last 30 days Overall leaderboard