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 / removing datetime from...
Power Automate
Unanswered

removing datetime from file name

(0) ShareShare
ReportReport
Posted on by

Hi

 

I'm brand new to Power Automate and cant seem to google my way to an answer here. I download a new version of 10 different files every day and save them to a data folder. Each day I want to replace the old file. Each file downloads with the datetime on the end (always 19 characters). I want to automate the action of copying each of the 10 different files and pasting them into my data folder removing the datetime on the end and replacing the previous day's file. I wondered if textsplit might work but cannot see a way to utilise this within the file name and "rename file" does not seem to offer the amendments i need. Is it possible to do it this way? Is there a better way to go about this task?

 

Many Thanks

I have the same question (0)
  • kinuasa Profile Picture
    799 Most Valuable Professional on at

    I think that "Get file path part" and "Get subtext" actions could be used.

     

    SampleFlow_FileRename.png

     

    Folder.GetFiles Folder: $'''C:\\Downloads''' FileFilter: $'''*''' IncludeSubfolders: False FailOnAccessDenied: True SortBy1: Folder.SortBy.NoSort SortDescending1: False SortBy2: Folder.SortBy.NoSort SortDescending2: False SortBy3: Folder.SortBy.NoSort SortDescending3: False Files=> Files
    LOOP FOREACH CurrentItem IN Files
     File.GetPathPart File: CurrentItem RootPath=> RootPath Directory=> Directory FileName=> FileName FileNameWithoutExtension=> FileNameNoExtension Extension=> FileExtension
     IF FileNameNoExtension.Length > 19 THEN
     Text.GetSubtext.GetSubtext Text: FileNameNoExtension CharacterPosition: 0 NumberOfChars: FileNameNoExtension.Length - 19 Subtext=> Subtext
     File.RenameFiles.Rename Files: CurrentItem NewName: Subtext KeepExtension: True IfFileExists: File.IfExists.Overwrite RenamedFiles=> RenamedFiles
     File.Copy Files: RenamedFiles Destination: $'''C:\\Downloads\\Dest''' IfFileExists: File.IfExists.Overwrite CopiedFiles=> CopiedFiles
     END
    END
    
    # [ControlRepository][PowerAutomateDesktop]
    
    {
     "ControlRepositorySymbols": [],
     "ImageRepositorySymbol": {
     "Name": "imgrepo",
     "ImportMetadata": {},
     "Repository": "{\r\n \"Folders\": [],\r\n \"Images\": [],\r\n \"Version\": 1\r\n}"
     }
    }

     

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
11manish Profile Picture

11manish 227

#2
David_MA Profile Picture

David_MA 204 Super User 2026 Season 1

#3
Valantis Profile Picture

Valantis 177

Last 30 days Overall leaderboard