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 / Automate copying files...
Power Automate
Suggested Answer

Automate copying files from SharePoint to various specified folders

(1) ShareShare
ReportReport
Posted on by 10
On Sharepoint I have a folder called 'Studies'. Inside this folder I have various sub-folders for example: Research Proposal, Supervisors, Degree Certificate, References. Students upload one or more documents to each folder. The document(s) they upload should include their Student ID and Name (which most do) but they also add other text e.g. Bill Jones 3432920 Research Proposal. They also include some documents, which I don't want to be copied (but I can copy them and delete them later on if needed). I then create folders on my local drive (but it could be on my One Drive or another SharePoint site) for each student and call the folder the Student's ID and Name e.g. 3432920-Bill_Jones. I then have to download each of the students' documents from the various folders on the Sharepoint site into their appropriate folder (which when there are 100s, this takes days to do). Is there a way to automate copying the files into the folders? Fortunately, I have found a quick way of creating the folders using a .bat file. I am relatively inexperienced with Power Automate and have no knowledge of code.
 
I would be immensely grateful if anyone could help.
Categories:
I have the same question (0)
  • Cgangweg01 Profile Picture
    893 Super User 2026 Season 1 on at
     
    Power Automate is a good choice for copying files.
    You wrote the following copied below. Are the students including their name and ID in the document file name?
     
    The document(s) they upload should include their Student ID and Name (which most do) but they also add other text e.g. Bill Jones 3432920 Research Proposal.
     
    Super high-level outline of a potential flow without coding could be:
    -trigger when a file is created in a folder
    -actions to interrogate the file and meta data to determine which student it is
    -actions to copy file to appropriate folder
     
    Happy to assist but I would need more info about the file name, I think.
     
     
  • ER-24011728-0 Profile Picture
    3 on at
    Thank you so much for the reply.
     
    Yes, students should be including their ID and name on the document file name (which 98% do). However, they don't all do it in the same way. So some examples could be:

    1234567 Paige Turner Research Proposal
    Research Proposal_Dwayne_Pike_7654321
    RP-9876543-Tom-Bowler
    9876543_Tom_Bowler RP amended
     
    All IDs should have 7 numbers in them, if that helps at all.
     
    For the small minority who don't include their ID I could do it manually for these ones.
     
    If there is more than one version of the document sometimes this is permitted for example degree certificate but for other documents such as the research proposal students are only allowed one so it would be helpful to have the date and time on the title of the copied document so that I know which is the latest submission. If this isn't possible, then again I can work through this manually.
     
    Also, I don't need it to be tiggered when a document is created a) because I don't do anything with these documents until the deadline has passed and b) because I won't have created all the folders until the deadline has passed. So I think a flow that I trigger manually would be best.
     
    Any other questions, please let me know.
     
    I look forward to your reply!
     
     
     
  • CU22012034-0 Profile Picture
    10 on at
    @Cgangweg01 - apologies that other post above is from me (I seem to have managed to reply from my other account), apologies for any confusion!
  • Cgangweg01 Profile Picture
    893 Super User 2026 Season 1 on at
    Hello!
     
    Just wanted to let you know that I have worked on this. It is a flow I could possibly leverage so I liked the challenge.
    Also, the forum platform never notified me that you replied, or I missed it somehow.
     
    Anyway, below is a picture of the flow so far (in thirds). The biggest challenge to this point was getting the student ID number out of the random file names. This flow does that by iterating through each character of the file name string and pulling out the digits only into another string. Students could easily break this by including digits other than the ID number in their file name.
     
    I followed this youtuber's video. It was the best solution I could find because there is no simple way provided by Power Automate expressions.
     
    I'll provide each actions configuration separately tomorrow.
     
    The next part to figure out is how to use the student ID that has been obtained to identify the folder to move the file to. If the folder was just the 7-digit student number, it would be a snap.
     
  • CU22012034-0 Profile Picture
    10 on at
    @Cgangweg01 Many thanks for your efforts - it's sounding promising!
  • Suggested answer
    Cgangweg01 Profile Picture
    893 Super User 2026 Season 1 on at
    Hi!
     
    Attached document illustrates each action.
    Let me know if you have any questions.
     
  • CU22012034-0 Profile Picture
    10 on at
    @Cgangweg01 - thank you!
     
    I'll try this out when I'm back at work next week! Did you have any inspiration on getting the files into the correct folder?

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 377

#2
11manish Profile Picture

11manish 279

#3
David_MA Profile Picture

David_MA 234 Super User 2026 Season 1

Last 30 days Overall leaderboard