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 / rename file with perso...
Power Automate
Answered

rename file with personalised date in power automate desktop

(1) ShareShare
ReportReport
Posted on by 7

Hello , 

I want to rename each monday a file  like this 

 

Name of the file ; ETATS-GRF-STOCK-HEBDO.CSV

After the last word, I want to insert the date of the file - 7 days 

 

Here the result : ETATS-GRF-STOCK-HEBDO 01-07-2024.csv  ( 01 is the day and 07 is the month )

 

How can I do thas in my flow ? 

yamina_0-1720427281546.png

 

I have the same question (0)
  • Verified answer
    eetuRobo Profile Picture
    4,583 Super User 2026 Season 2 on at

    1. Get current date (date only)

    eetuRobo_2-1720428222296.png

     

    2. Format the date to custom date time

    eetuRobo_1-1720428213658.png


    3. Use that FormattedDateTime -variable in the new file name just before the file extension (.csv)

    eetuRobo_0-1720428202510.png


    Looks like this as a whole:

    eetuRobo_3-1720428256182.png

     

  • Verified answer
    VishnuReddy1997 Profile Picture
    2,666 Super User 2026 Season 1 on at

    Hi @yamina ,

     

    Please find the solution.

    VishnuReddy1997_0-1720428439029.png

    Code:

    FUNCTION '7Days' GLOBAL
     DateTime.GetCurrentDateTime.Local DateTimeFormat: DateTime.DateTimeFormat.DateOnly CurrentDateTime=> CurrentDateTime
     DateTime.Add DateTime: CurrentDateTime TimeToAdd: -7 TimeUnit: DateTime.TimeUnit.Days ResultedDate=> ResultedDate
     Text.SplitText.Split Text: ResultedDate StandardDelimiter: Text.StandardDelimiter.Space DelimiterTimes: 1 Result=> ResultedDate
     File.RenameFiles.Rename Files: $'''C:\\Users\\Downloads\\mjlangone_0-1719864376475.png''' NewName: $'''ETATS-GRF-STOCK-HEBDO %ResultedDate[0]%.csv''' KeepExtension: True IfFileExists: File.IfExists.Overwrite RenamedFiles=> RenamedFiles
    END FUNCTION

     

    (Note:- if you got your solution you can mark as solution and gives kudos)


    Thanks & Regards

    Vishnu Reddy

     

  • yamina Profile Picture
    7 on at

    Thank you @eetuRobo, your solution helped me but a step was missing. 

    CurrentDateTime TimeToAdd: -7

    so I combine the two answers and here the result

    yamina_0-1720431400577.png

     

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 253 Super User 2026 Season 2

#2
11manish Profile Picture

11manish 172 Super User 2026 Season 2

#3
trice602 Profile Picture

trice602 134 Super User 2026 Season 2

Last 30 days Overall leaderboard