cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
grantjenkins
Frequent Visitor

Renaming SharePoint file using REST API with Power Automate cuts off everything when it sees a period

Within Power Automate, I'm using the SharePoint REST API action (Send an HTTP request to SharePoint) to rename a SharePoint file.

It all works perfectly, except for when I want to include a period as part of the name.

Example: I have a file named Test.docx and I want to concatenate the version number to the name which might be 1.0, 3.4, etc.

But for some reason the REST API seems to see a period and only take the stuff on the left of it.

So if the version number was 1.2 then the renamed file would end up being Test 1.docx. If the version number was 0.5 then it would be renamed as Test 0.docx.

Does anyone have any idea how to include the period and everything after it so I get something like Test 0.5.docx?

Below is the Power Automate steps.

grantjenkins_1-1615344139552.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
jinivthakkar
Super User
Super User

@grantjenkins you need to pass the filename with extension

 

jinivthakkar_0-1615397629273.png

I was able to reproduce the issue if I just pass 1.13 but if I pass 1.13.pdf  it works.

 

You will also get file extension from Get file properties and then concat the name.version.extension and pass.

--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

 

 

View solution in original post

3 REPLIES 3
jinivthakkar
Super User
Super User

@grantjenkins you need to pass the filename with extension

 

jinivthakkar_0-1615397629273.png

I was able to reproduce the issue if I just pass 1.13 but if I pass 1.13.pdf  it works.

 

You will also get file extension from Get file properties and then concat the name.version.extension and pass.

--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

 

 

grantjenkins
Frequent Visitor

See my reply.

Thanks so much - works perfectly. Note that I had to extract the file extension out of the "File name with extension" property - would be great if they just included a property with just the extension, but beggars can't be choosers 🙂

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

Carousel_PP_768x460_Wave2 (1).png

2022 Release Wave 2 Plan

Power Platform release plan for the 2022 release wave 2 describes all new features releasing from October 2022 through March 2023.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (5,079)