Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

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

Like (0) ShareShare
ReportReport
Posted on 7 Mar 2020 05:32:13 by 6
  • neethika Profile Picture
    15 on 09 Mar 2020 at 14:47:16
    Re: Flow to automatically append date to filename in sharepoint whenever someone creates a new file or modifies ?

    Sounds good. Please mark the reply of yours to which I gave Kudos!

    Thanks,

    Nreddy

  • yashag2255 Profile Picture
    24,584 Super User 2024 Season 1 on 09 Mar 2020 at 14:22:43
    Re: Flow to automatically append date to filename in sharepoint whenever someone creates a new file or modifies ?

    Hi @Nreddy / @neethika 

     

    I can mark it as solved for you. Can you share which reply(ies) you want to mark as answered? 

     

    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 09 Mar 2020 at 13:57:29
    Re: Flow to automatically append date to filename in sharepoint whenever someone creates a new file or modifies ?

    Hi,

    I want to mark it as solved but I am unable to see any option to do that. I'' check again

    Thanks,

    Neethi

  • neethika Profile Picture
    15 on 09 Mar 2020 at 13:37:32
    Re: Flow to automatically append date to filename in sharepoint whenever someone creates a new file or modifies ?

    Hi Yash,

     

    This configuration worked 🙂 Thank you so much for your time and response, greatly appreciate it!

     

    I was able to append date to file name whenever someone add a file to document library. I will test all the uses cases now.

     

    Best,

    Nreddy

  • v-litu-msft Profile Picture
    on 09 Mar 2020 at 08:09:36
    Re: Flow to automatically append date to filename in sharepoint whenever someone creates a new file or modifies ?

    Hi @neethika,

     

    Has your problem been solved by @yashag2255's advice?

     

    The best approach is @yashag2255 provided, if the newly created file name has no date or file date in the modified file name not match today, create a new file by using filename today+filename.


    If your problem has been solved, You could go ahead and mark the post as solved by clicking “Accept as Solution” so that this thread will be marked for other users to easily identify!

    Best Regards,
    Community Support Team _ Lin Tu

  • Verified answer
    yashag2255 Profile Picture
    24,584 Super User 2024 Season 1 on 08 Mar 2020 at 05:41:50
    Re: Flow to automatically append date to filename in sharepoint whenever someone creates a new file or modifies ?

    Hi @neethika  @Nreddy 

     

    You might want to try with the below configuration once: 

    rr44.PNG

     

    Here, I have added the get file metadata with path and used the display name in the expressions so that it works as expected. 

    expressions: 

    Condition Left: first(split(body('Get_file_metadata_using_path')?['DisplayName'],'_'))
    COndition Right: utcNow('dd-MM-yyyy')
    
    File Name: utcNow('dd-MM-yyyy')

     

     

    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!

  • efialttes Profile Picture
    14,756 on 07 Mar 2020 at 22:28:12
    Re: Flow to automatically append date to filename in sharepoint whenever someone creates a new file or modifies ?

    Hi again!

     

    I guess the warning comes from the fact you are using the 'When a file is created or modified in a folder' trigger.

    If you use 'Whe a file is created' instead, I guess the warning should not be shown. But, not sure if this other trigger matches your requirements.

     

    Hope this helps

  • efialttes Profile Picture
    14,756 on 07 Mar 2020 at 21:35:06
    Re: Flow to automatically append date to filename in sharepoint whenever someone creates a new file or modifies ?

    Hi!

    My suggestion, try to upload a new file, see if issue persists.

    If so,

    1.-inspect Flow executions related to this new file uploaded. You will probably need to inspect the last two executions

    2.-inspect the new file metadata columns on your SP library, by making Created and Modified properties visible on your SP view

    Share the results

     

     

  • neethika Profile Picture
    15 on 07 Mar 2020 at 21:17:13
    Re: Flow to automatically append date to filename in sharepoint whenever someone creates a new file or modifies ?

    error.pngScreenshot.png

    I updated the flow with the updated expression that you shared but I still see the date appending twice. But I see a warning which I attached. This could be causing date appending multiple times. Is there any solution for this? Thank you, Nreddy

  • efialttes Profile Picture
    14,756 on 07 Mar 2020 at 19:52:16
    Re: Flow to automatically append date to filename in sharepoint whenever someone creates a new file or modifies ?

    @Nreddy @neethika 

    I'm running some test on my side, it seems the old trick suggested is not valid anymore. Probably Microsoft Engineers changed the logic some time ago and we did not noticed ☹️

    This is the content of

    first(split(triggerOutputs()['headers']['x-ms-file-name-encoded'],'_'))

    in my last execution:

    MDctMDMtMjAyMF9GbG93LlBORw==

     

    THere is probably a WDL function to decode it, but in the meantime I have inspected the whole triggerOutputs()['headers'] object structure and found a fast workaround:

     

    {
     "Pragma": "no-cache",
     "Retry-After": "0",
     "x-ms-file-id": "%252fDocumentos%2bcompartidos%252f07-03-2020_Flow.PNG",
     "x-ms-file-name": "07-03-2020_Flow.PNG",
     "x-ms-file-path": "/Documentos compartidos/07-03-2020_Flow.PNG",
     "x-ms-file-name-encoded": "MDctMDMtMjAyMF9GbG93LlBORw==",
     "x-ms-file-path-encoded": "L0RvY3VtZW50b3MgY29tcGFydGlkb3MvMDctMDMtMjAyMF9GbG93LlBORw==",
     "x-ms-file-etag": "\"{C4F63058-AAF4-4C52-8DD4-087D9E3DF0AD},2\"",
     "x-ms-request-id": "e08a3c9f-c07d-b000-6ed8-3c92a7674c56;e08a3c9f-a081-b000-6ed8-3c169b44d2fb",
     "Strict-Transport-Security": "max-age=31536000; includeSubDomains",
     "X-Content-Type-Options": "nosniff",
     "X-Frame-Options": "DENY",
     "Timing-Allow-Origin": "*",
     "x-ms-apihub-cached-response": "true",
     "Cache-Control": "no-store, no-cache",
     "Date": "Sat, 07 Mar 2020 19:38:03 GMT",
     "Location": "https://flow-apim-europe-001-westeurope-01.azure-apim.net/apim/blablabla",
     "Set-Cookie": "ARRAffinity=blebleble;Path=/;HttpOnly;Domain=sharepointonline-ne.azconn-ne.p.azurewebsites.net",
     "Content-Length": "13763",
     "Content-Disposition": "attachment",
     "Content-Type": "image/png",
     "Expires": "-1",
     "Last-Modified": "Sat, 07 Mar 2020 19:38:04 GMT"
    }

     

    So I would suggest to use this other fast dirty workaround expression in the left side of your Condition:

    first(split(last(split(triggerOutputs()['headers']['x-ms-file-path'],'/')),'_'))

     Hope this helps

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1

Loading started