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 / Copy files from one Sh...
Power Automate
Suggested Answer

Copy files from one SharePoint to another while excluding specific file (.mp4, .m4a, .vtt, .vsdx)?

(0) ShareShare
ReportReport
Posted on by 2
Hi everyone,
I am trying to build a Power Automate cloud flow that copies files from 
one SharePoint document library to another SharePoint document library. 
However, I do NOT want to copy ALL files — I need to exclude certain 
file types from being copied.
**File types to EXCLUDE:**
- .mp4
- .m4a
- .vtt
- .vsdx
**What I want:**
All other files (e.g., .pdf, .docx, .xlsx, .pptx, .png, etc.) should 
be copied from the source SharePoint library to the destination 
SharePoint library.
**My current flow setup:**
1. Get updated/modifief files only ( check the file type of the updated or modified type)
   SharePoint document library
3. Action: "For Each" — looping through all the files returned
4. Inside the loop: I want to add a **Condition** to check the file 
   extension and skip the excluded types
5. If the condition passes: 
   - "Get file content" from source
   - "Create file" in destination SharePoint library
I have the same question (0)
  • Suggested answer
    David_MA Profile Picture
    15,101 Super User 2026 Season 1 on at
    It seems the issue you are having is with excluding the file types you don't want to retrieve. I would set up your flow like this:
     
     
    • In the Get files action, I would add this filter query to exclude it from returning folders: ContentType ne 'Folder'
    • I limited the get files to 10 items for demo purposes. Depending on how many files you have, you'll probably need to turn on pagination and specify a limit since it will only return 100 items by default. Therefore, you'll probably need to expand the filter query, so it only gets files you really want to copy.
    • This is the filter to use in the filter array action to exclude the files you don't want (you'll need to put it in advanced mode to enter it):
      • @not(or(endsWith(item()?['{Name}'], '.mp4'), endsWith(item()?['{Name}'], '.m4a'), endsWith(item()?['{Name}'], '.vtt'), endsWith(item()?['{Name}'], '.vsdx')))
    • In the Get file properties action, use this expression to return the ID value from the filter array for the current item in the apply to each: item()?['ID']
    • You can then use the identifier from the Get file properties action to get the file content in order to create the new file.
     
  • RC-16071055-0 Profile Picture
    2 on at
     
    If i change the trigger to get updated/ modified files how to redo ? 
     
  • David_MA Profile Picture
    15,101 Super User 2026 Season 1 on at
    I am not aware of a trigger to get updated/modified files. Based on what you described you wanted to do, you would use either a manually triggered or scheduled flow. If you're referring to this trigger:
     
     
    If you want to use that trigger, then the approach would be different. You would add the expression as a trigger condition so the workflow does not even run if it is one of the file types you want to exclude:
    Here is the expression and it needs the at symbol at the front of it when used in a trigger condition:
     
    @not(or(endsWith(triggerBody()?['{FilenameWithExtension}'],'.mp4'),endsWith(triggerBody()?['{FilenameWithExtension}'],'.m4a'),endsWith(triggerBody()?['{FilenameWithExtension}'],'.vtt'),endsWith(triggerBody()?['{FilenameWithExtension}'],'.vsdx')))
     
    Note, it is case-sensitive, so if a file ended with .VTT the flow would trigger. If that is a concern, you can force the filename to all lowercase like this:
     
    @not(or(endsWith(toLower(triggerBody()?['{FilenameWithExtension}']),'.mp4'),endsWith(toLower(triggerBody()?['{FilenameWithExtension}']),'.m4a'),endsWith(toLower(triggerBody()?['{FilenameWithExtension}']),'.vtt'),endsWith(toLower(triggerBody()?['{FilenameWithExtension}']),'.vsdx')))
     
    For a workflow to trigger with a trigger condition, the condition must evaluate to true.

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 June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 250 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 180

#3
Haque Profile Picture

Haque 159

Last 30 days Overall leaderboard