Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Generate email based on file type uploaded to SharePoint Library

(0) ShareShare
ReportReport
Posted on by 81

Hello all..
I have a library where multiple people are supposed to upload ONLY xlsx files.  I need a flow that:
1. Is triggered when a file is uploaded that is NOT an xlsx (excel) file.
2. Sends and email to the person that did the upload and to 2 other people (administrators of the library). That has a standard "blurb" about the wrong file type, and has the name of the file, and the date and time the wrong file was uploaded.

Thanks All

  • Verified answer
    v-duann-msft Profile Picture
    on at
    Re: Generate email based on file type uploaded to SharePoint Library

    Hi @12strikes 

     

    Thank you for posting.

     

    According to your description, you would like to restrict users only upload excel file to library. If any misunderstanding, please kindly let me know.

     

    Here is the flow details:

    v-duann-msft_0-1614586307277.png

     

    v-duann-msft_1-1614586307282.png

     

    Hope the content above may help you.

     

    Thanks

    Anna

  • Mitanshu Profile Picture
    1,635 Super User 2025 Season 1 on at
    Re: Generate email based on file type uploaded to SharePoint Library

    TL;DR: Use the expression to find if file is an .xlsx :  endsWith(triggerOutputs()?['headers/x-ms-file-id'],'.xlsx')

     

    Details:

    Step 1 : Automated Flow (when a new file is created in SharePoint Folder)

    Step 2 : Condition using expression listed above

    Step 3 : if false, send an email saying wrong file type

    Step 4 : if true, do nothing

     

    Under this method, you will be wasting your daily Flow runs allowance as whenever an .xlsx is uploaded the Flow will run and do nothing. To mitigate this, you can add a trigger condiiton to your flow.

     

    --

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1