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 i can check if the...
Power Automate
Suggested Answer

How i can check if the uploaded file inside a document library is a video

(0) ShareShare
ReportReport
Posted on by 2,057 Season of Giving Solutions 2025
I have a sharepoint online document library where users upload different types of files, such as documents, images and videos. now i want to develop a power automate workflow that only run when a new video is uploaded .. how i can achive this?
 
Thanks
I have the same question (0)
  • Suggested answer
    ScottShearer Profile Picture
    25,327 Most Valuable Professional on at
    The only way that I can think of is to use a trigger filter and check the file extension - if it is a video file, the expression should return false.
     
    Example video extensions include:
    .mp4
    .avi
    .mov
    but there are quite a few others.
     
    Here is an expression that you can use:
     
    or(
      contains(triggerBody()?['{FilenameWithExtension}'],'.mp4'),
      contains(triggerBody()?['{FilenameWithExtension}'],'.avi')
    )
     
    Of course, you'll need to add all the extensions that you want to check.
     
    You'll need to add a @ before the expression when adding it as a trigger condition.
     
    An easy way to test is to put the expression in a Compose action.  If it works, move it to a trigger filter.
     
    Let me know if you need more help.
     
    Scott J Shearer
  • Suggested answer
    Ellis Karim Profile Picture
    12,251 Super User 2026 Season 2 on at
     
    Another option is to use a Get file metadata action, and check the MediaType property, which will start with "video":
    "MediaType": "video/x-ms-wmv"
    "MediaType": "video/webm"
    "MediaType": "video/quicktime"
    "MediaType": "video/mp4"
     
    This can reliably detect a video file without checking the file extension, but the downside is that you can't use this property in a trigger action, as it is not exposed.
     
     
    Ellis Karim
    Ellis Karim
    elliskarim.com  |  LinkedIn  |  Bluesky
    If this solved your issue, please mark it as ✅ Accepted Answer. If it helped, feel free to give it a 🩷 Like!
     
     
     
  • Suggested answer
    Syed Aqib Raza Profile Picture
    2 on at

    Yes, this can be achieved in Power Automate. The easiest approach is to use the SharePoint trigger “When a file is created (properties only)” and then check the uploaded file's content type or extension.

    Approach 1: Check the file extension

    After the SharePoint trigger, add a Condition and use the following expression:

    or(
        endsWith(toLower(triggerOutputs()?['body/{FilenameWithExtension}']), '.mp4'),
        endsWith(toLower(triggerOutputs()?['body/{FilenameWithExtension}']), '.mov'),
        endsWith(toLower(triggerOutputs()?['body/{FilenameWithExtension}']), '.avi'),
        endsWith(toLower(triggerOutputs()?['body/{FilenameWithExtension}']), '.mkv'),
        endsWith(toLower(triggerOutputs()?['body/{FilenameWithExtension}']), '.wmv'),
        endsWith(toLower(triggerOutputs()?['body/{FilenameWithExtension}']), '.webm')
    )
    

    If the condition is true, continue with your video-processing actions. Otherwise, terminate the flow.

    Approach 2: Check MIME / Content Type

    A better approach is to check the file's MIME type. Video files generally have a content type such as:

    video/mp4
    video/quicktime
    video/webm
    

    After Get file metadata, you can check whether the content type starts with video/:

    startsWith(
        toLower(outputs('Get_file_metadata')?['body']['MediaType']),
        'video/'
    )
    

    This means you don't have to maintain a list of every possible video extension.

    Even better: Use Trigger Conditions

    If the library contains a large number of files, I would recommend putting the condition in the trigger itself. This prevents the flow from actually running for PDFs, images, Word files, etc.

    Go to:

    Trigger → Settings → Trigger Conditions

    and add a condition based on the file extension/content type.

    For example:

    @or(
        endsWith(toLower(triggerOutputs()?['body/{FilenameWithExtension}']), '.mp4'),
        endsWith(toLower(triggerOutputs()?['body/{FilenameWithExtension}']), '.mov'),
        endsWith(toLower(triggerOutputs()?['body/{FilenameWithExtension}']), '.avi'),
        endsWith(toLower(triggerOutputs()?['body/{FilenameWithExtension}']), '.mkv')
    )
    

    So the overall flow becomes:

    SharePoint → When a file is created → Trigger Condition → Video only → Process video

    This is more efficient because non-video uploads won't trigger unnecessary flow runs.

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 298 Super User 2026 Season 2

#2
trice602 Profile Picture

trice602 159 Super User 2026 Season 2

#3
11manish Profile Picture

11manish 150 Super User 2026 Season 2

Last 30 days Overall leaderboard