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 / Rename file in sharepo...
Power Automate
Unanswered

Rename file in sharepoint with Expressions

(1) ShareShare
ReportReport
Posted on by

It has taken me a good deal of browsing and meddling to get this flow to work. My main hurdles was:

  1. It is cumberhensome to change the name of the file in SP with flow
  2. Present methods did not allow the use of expressions in the renaming in SP.

 

Solution:

move the file from SP to OD, rename it in OD, move it back to SP  and delete any traces. This loop takes a template and produces a weekly report every friday. I hope it can help others or at least inspire to a more simple flow.

 

Flow programme: 

 

  1. SP-Get File Metadata  --> SP-Get File content --> OD-Create file
    This section identifies the file in question in Sharepoint, takes the content and create a copy of the file in One Drive

  2. OD-Get File Metadata --> OD-Get file content --> OD-copy file
    This section identifies the file when its located in OneDrive, holds the content and rename it in the copy process. By renaming it in OneDrive it is possible to use expressions in the naming of the file. 
    For example for printing week number I have used the expression: div(add(dayOfYear(utcNow()), 7), 7).

  3. SP-Create file --> SP-Create Sharing link for a file or folder ---> OD-Delete file
    Create the file based on the name and content from section 2.
    Also creates a link to the renamed file to be used in an email
    Finally it deletes the file that was created on OneDrive as it only served to rename the originial file.

NB. It is eesential to use dynamic content in all the steps in this flow. 


Disclaimer: The programme is messy and cumberhensome, I have used a lot of effort to get here since Flow is still limited with SP tools. And to be frank I am tired of this programme by now, Flow should have been able to do this simple operation much easier.

Categories:
I have the same question (0)
  • Community Power Platform Member Profile Picture
    on at

    Capture.PNG

     

     

  • Verified answer
    Community Power Platform Member Profile Picture
    on at

    Part 1/2Part 1/2

     

    Part 2/2Part 2/2

     

     

  • Gilmour Profile Picture
    362 on at

    Great solution!

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 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard