cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
danielfeatley
Level: Powered On

Renaming files using a Flow

Hello Apologies for the double post but I am looking for assistance. I came across this post https://powerusers.microsoft.com/t5/Building-Flows/Modify-Dynamic-Content-Before-Use-in-Flow/m-p/118..., and I think it may help with a problem I'm having. I get tens of spreadsheets sent to me every month, all with filenames that are composed of random numbers. This flow successfully moved them to my Sharepoint library and renamed it with the datestamp. How can I adapt this flow to name a file specifically so I can use formula in Excel to refer to it? I would also like the flow to remove the existing filename completely before renaming it (in my example the original file was called Book1) For example: This Flow renamed my file: 201805240242Book1 Can I make the flow call the file: PhoneDataParks Any help would be appreciated Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Renaming files using a Flow

Hi @ danielfeatley,

 

 

Please refer to screenshot below to create the flow:

Capture.PNG

 

The expression in the Compose as below:

concat('PhoneDataParks','.',first(skip(split(items('Apply_to_each')?['Name'],'.'),1)))

Also you could change the Compose Action input with the formula below:

"@concat('PhoneDataParks','.',first(skip(split(items('Apply_to_each')?['Name'],'.'),1)))"

 

 

When a new email arrives with an attachment, the flow would run successfully as below:

Capture.PNG

 

The file would be created in the folder as below:

Capture.PNG

 

 

Please let me know if your problem could be solved.

 

 

Regards,
Alice Zhang

6 REPLIES 6
Community Support Team
Community Support Team

Re: Renaming files using a Flow

Hi @ danielfeatley,

 

 

Please refer to screenshot below to create the flow:

Capture.PNG

 

The expression in the Compose as below:

concat('PhoneDataParks','.',first(skip(split(items('Apply_to_each')?['Name'],'.'),1)))

Also you could change the Compose Action input with the formula below:

"@concat('PhoneDataParks','.',first(skip(split(items('Apply_to_each')?['Name'],'.'),1)))"

 

 

When a new email arrives with an attachment, the flow would run successfully as below:

Capture.PNG

 

The file would be created in the folder as below:

Capture.PNG

 

 

Please let me know if your problem could be solved.

 

 

Regards,
Alice Zhang

danielfeatley
Level: Powered On

Re: Renaming files using a Flow

Alice

 

I've built the Flow this morning and it seems to do exactly what I asked!

 

Thank you so much!

 

Daniel

AnaGeorgiev
Level: Powered On

Re: Renaming files using a Flow

Thank you so much for this. You've saved me a lot of time.

Snoop62
Level: Powered On

Re: Renaming files using a Flow

Hi @v-yuazh-msft 

 

I have a question.
Can I change the name of the file using the body text from the email.
I can change the name of the files without problems but as soon as I want to open the document on sharepoint an error occurs

AnaGeorgiev
Level: Powered On

Re: Renaming files using a Flow

Are you naming the document as a file type? For a Word file, you would want to name it "Output.docx" or for a Powerpoint, "Output.pptx"

crobbins
Level: Power Up

Re: Renaming files using a Flow

I am trying to get the attachement from an email to save in a file, and be renamed beginning with today's date (09-12-19) and the subject line (or just a portion of it if possible). I have the attachement saving to a file loaction but i am stuggling with the rename process. Can anyone help?

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020.

thirdimage

Flow Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 196 members 4,216 guests
Please welcome our newest community members: