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 / Duplicate or copy a sh...
Power Automate
Unanswered

Duplicate or copy a sharepoint file to new location and rename at the same time

(0) ShareShare
ReportReport
Posted on by 59

1. I have file name called ReportTemplate.docs from a document library name Reports

2. I want to run a recurring flow every Friday at night to make a duplicate copy of the ReportTemplate.docs with a new filename so for upcoming Monday, the duplicate copy should have a file name 2018-09-24ReportTemplace.docs

 

Thank you for your help.

Categories:
  • v-yamao-msft Profile Picture
    Microsoft Employee on at

    Hi @NBMS_2019,

     

    Do you want to move the file from one library to another by adding a timestamp into the file name?

     

    To run the flow every Friday at night, please use the trigger Recurrence. For testing, I just use Button to trigger the flow.

     

    Then get the specific file and file content that you want to copy using the action Get file metadata and Get file content.

     

    Last, Create file into the destination library. In the File name field, use the following code before the dynamic content Display Name:

    formatDateTime(addDays(utcnow(),4),'yyyy-MM-dd')

     

    It works just fine, please take the following images for a reference and try it on your side.

    1.PNG2.PNG

     

    Best regards,

    Mabel Mao

  • NBMS_2019 Profile Picture
    59 on at

    Thank you so much for your reply but the logic changed. 

     

    So the new logic is...

    - Recurring flow is schedule 5pm every Monday

    - Look for a file modified after 12noon that day. For example, next Monday is Sept 24th. Look for the file modified the last 5 hours so if my recurring action is scheduled at 5pm, look for this file modified between 12-5pm. There is always one file being edited by many users every Monday and the last time they can edit it is between 12-5pm on Monday.

    - Make a duplicate copy of this file, saving it on the same library with the same filename but with a date inserted for Monday next week which is now October 1 .

     

    I appreciate your help. Thank you again.

  • NBMS_2019 Profile Picture
    59 on at

    one.pngIt is blowing up at "Apply to Each" actionIt is blowing up at "Apply to Each" action

     

     

  • hlokey Profile Picture
    9 on at

    Hello @NBMS_2019 , 

     

    I am trying to do something similar but a bit stuck: I want to copy picture files from one folder to another and rename the new file using the source folder names. I do not care if this is triggered when the image files are created or as a recurring flow (daily). 

     

    For example: if a picture (with a generic name like "IMG2365.jpg") is added to the nested folders Guatemala > Buena Vista > Installation, I want to create a copy of the picture file. The new file in the destination folder should be named "Buena Vista_Guatemala_Installation" or something like that, and have the same file details (like date created) as the original file.

     

    Ultimately I want to copy these to a picture library, but right now I'm just testing outflows in our standard file library. 

     

    Can you help me with limiting the copy to image files and renaming using the source folders?

     

    Thanks.

  • kjwolf326 Profile Picture
    36 on at

    Hello, 

    I'm looking to do something similar as well.  I'm looking to have a "Comic of the Day" on my SharePoint modern intranet homepage, and cannot figure out anyway to do this.  I have a new comic for each day, and currently have a unique show by date as a column in a list.  I used a custom view in a list, but it shows much too small as a list view on the page.  I'd ideally like to use the Image Gallery webpart, and have it show a new picture each day.  

     

    I'm thinking I'd like to have power automate copy a new file based on "show Date" into an image library, and then change the name to "comic of the day", and replace the existing image in that library.  This would ensure the URL to that picture didn't change, but the actual image/comic would.  Any help or pointers would be MUCH appreciated!!

    Thanks

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

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 321 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 244

#3
Henil Profile Picture

Henil 102

Last 30 days Overall leaderboard