cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AIPedersen
New Member

Rename file in sharepoint with Expressions

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.

1 ACCEPTED SOLUTION

Accepted Solutions

Part 1/2Part 1/2

 

Part 2/2Part 2/2

 

 

View solution in original post

2 REPLIES 2
AIPedersen
New Member

Capture.PNG

 

 

Part 1/2Part 1/2

 

Part 2/2Part 2/2

 

 

View solution in original post

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Users online (19,491)