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 / When a file is created...
Power Automate
Unanswered

When a file is created, Rename it with a prefix

(0) ShareShare
ReportReport
Posted on by

Hello, 

 

Hello, I'm looking for a Power Automate flow that allows me to rename a file just added in a  sharepoint folder, with the month and year + "-" as a prefix 

 

Categories:
I have the same question (0)
  • grantjenkins Profile Picture
    11,063 Moderator on at

    This is how I'd build the flow.

     

    See full flow below. I'll go into each of the actions.

    grantjenkins_0-1701529169750.png

     

    When a file is created will trigger when a new file is created.

    grantjenkins_1-1701529186674.png

     

    Compose builds up your new name by concatenating the current Month and Year followed by a hyphen followed by the current name.

    concat(formatDateTime(utcNow(), 'MM-yyyy'), '-', triggerOutputs()?['body/{Name}'])

    grantjenkins_2-1701529219980.png

     

    Send an HTTP request to SharePoint renames the file using the following.

    //Method
    POST
    
    //Uri
    //Note that you will need to specify the Display Name of your Library in place of Documents
    _api/web/lists/GetbyTitle('Documents')/items(@{triggerOutputs()?['body/ID']})/validateUpdateListItem
    
    //Body
    {
     "formValues": [
     {
     "FieldName": "FileLeafRef",
     "FieldValue": "@{outputs('Compose')}"
     }
     ]
    }

    grantjenkins_3-1701529311024.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

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