web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Flow to automatically ...
Power Automate
Answered

Flow to automatically append date to filename in sharepoint whenever someone creates a new file or modifies ?

(0) ShareShare
ReportReport
Posted on by 6
Categories:
I have the same question (0)
  • yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    Hi @Nreddy 

     

    Can you share more details? There is no direct action to rename a file in SharePoint

     

    You can always follow the below steps: 

     

    1. Trigger: When a file is created in a folder

    2. Split file name on - and check if the first part includes todays date. if yes do nothing. If no, 

    3. Get file content

    4. Create a new file (In the name of this file, add utcnow(dd-MM-yyyy)-filename.extension)

    5. Delete the original file. 

     

    Hope this helps!

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

  • Nreddy Profile Picture
    6 on at
    Hi Yash,

    Thank you for your prompt reply! The trigger is whenever a user adds new file in a document library or modifies I want the file name to be appended with date. I will follow your instructions and let you know if it worked out for me.
    Once again thank you 🙂
    Nreddy
  • Nreddy Profile Picture
    6 on at
    Hi Yash,
    If you dont mind would it be possible to send me screenshots of how to accomplish this? I am amateur to flows actually. Your help is very much appreciated please.
    Thank you in advance!
    Nreddy
  • yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    Hi @Nreddy 

     

    You can set up something as shown in the image below: 

     

    ff.PNG

     

    Expressions: 

    Condition Left: first(split(triggerOutputs()['headers']['x-ms-file-name-encoded'],'_'))
    Condition Right: utcNow('dd-MM-yyyy')
    File Name: utcNow('dd-MM-yyyy')

     Remember to add the '_' in the file name for this to work. 

    The file identifier in the delete file action comes from the output of the trigger action. 

     

    Hope this Helps!

     

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

  • Nreddy Profile Picture
    6 on at
    Hi Yash,
    I tried the steps mentioned and I was able to see that when I add a file date is getting appended to the file name. But I dont want the date to get appended to the file which was already appended with date and if it did not get modified. See the screenshot please. I see that everytime I add new file to the folder, date is getting appended to all the files causing the files to have multiple dates. Also If I modify the existing file I want the previous date to be placed by current data of modification.
    Hope I did not confuse and conveyed my message right.
    I appreciate you help alot , thank you 🙂
  • yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    Hi @Nreddy 

     

    Can you share a screenshot of your flow? I tested the flow shared and it worked fine for all the scenarios. Also, if the file is modified the same day more than once, it shouldn't really matter as the current day date is already appended to it. 

     

    Hope this Helps!

     

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

  • neethika Profile Picture
    15 on at

    flow.pngscreenshot.png

  • neethika Profile Picture
    15 on at

    The expressions I used in flow are:

    left :first(split(triggerOutputs()['headers']['x-ms-file-name-encoded'],'_'))
    right :utcNow('dd-MM-yyyy')
    file name: utcNow('dd-MM-yyyy')
    Thank you,
    Nreddy
     
     
  • efialttes Profile Picture
    14,756 on at

    @neethika @Nreddy 

    There is a crucial difference between @yashag2255 suggestion and your current flow implementation.

     

    In your implementation, when building the new file name; original file name is stored first, then you add a '_' symbol, then current date.

    Flow_yashag_wrong.PNG

    @yashag2255 implementation in just the opposite

    Flow_yashag_fine.PNG

     

    THis is the reason your condition will always fail

    Hope this helps

  • neethika Profile Picture
    15 on at

    Hi, I did change mine as per Yash's still I see the same thing happening. And for some reason even when I do not add any file or modify the date is appending multiple times. Not sure why thats happening.Please let me know where I am going wrong. Screenshot2.pngScreenshot.png

    Really appreciate your time and help, thanks!

    Nreddy

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 503 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 321 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard