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 and paste a docum...
Power Automate
Unanswered

Copy and paste a document with a standard name but including the week number

(0) ShareShare
ReportReport
Posted on by

Hello,

Relatively new to PA but needing some help with a couple of bits.

I have a working flow that every Monday morning will copy an Excel file and paste into another folder, basic but it works.

 

What i would like to happen is when the file is copied and pasted the name of the file stays the same as the source but it adds the current week number onto the end of the file name if thats possible as this is currently done manually.

The source file is a standard template and is copied by multiple other flows for other areas so this cant change.

 

e.g.

Source file to copy - Weekly Handover and Check Sheet for WK .xlsm

Required after copy - Weekly Handover and Check Sheet for WK35.xlsm

 

Thanks in advance.

Categories:
I have the same question (0)
  • Matthy79 Profile Picture
    4,188 Super User 2024 Season 1 on at

    Hello @Jay466 

     

    There is no easy way in Power Automate to format/calculate week number. I think you will calculate it on your own. I have a working calculation but I really hope there is a better way of doing it.

     

    concat(take(outputs('Compose_Filename_In'), lastIndexOf(outputs('Compose_Filename_In'), '.')), formatNumber(add(add(div(sub(dayOfYear(utcNow()),1),7), if(contains(createArray(1,2,3,4),dayOfWeek(concat(take(utcNow(),4), '-01-01'))), 1 ,0)), if(less(int(replace(string(dayOfWeek(utcNow())),'0', '7')),int(replace(string(dayOfWeek(concat(take(utcNow(),4), '-01-01'))),'0', '7'))), 1, 0)), '00'), '.', last(split(outputs('Compose_Filename_In'), '.')))

     

    This formula will calculate the first week as 00 if it starts before Thursday. I think this is better because otherwise you have 2- weeks with the number 52 or 53 and will get a file already exists error. But since you run this every Monday you won't recognize it.

     

    You will have to change "outputs('Compose_Filename_In')" to your actual file name.

     

    If it is not necessary to calculate the week numbers correctly, the formula could be way less complicated because you could just divide the number of days in this year by 7. That is something you have to check on your side.

     

    Hope someone finds a better solution.

  • Nived_Nambiar Profile Picture
    18,138 Super User 2026 Season 1 on at

    Hi @Jay466 

     

    see the possibility of using office scripts to compute week number as well.

     

    Thanks & Regards,

    Nived N 🚀

    LinkedIn: Nived N's LinkedIn
    YouTube: Nived N's YouTube Channel

    🔍 Found my answer helpful? Please consider marking it as the solution!
    Your appreciation keeps me motivated. Thank you! 🙌

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 276 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 169

#3
Haque Profile Picture

Haque 154

Last 30 days Overall leaderboard