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

Grant 1 Reputation point
2021-03-10T02:28:15.567+00:00

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?

Microsoft 365 and Office SharePoint For business Windows
{count} votes

3 answers

Sort by: Most helpful
  1. ZhengyuGuo 10,586 Reputation points Moderator
    2021-03-10T08:00:58.757+00:00

    Hi @Grant ,

    I tested to update the file name to Test 0.5.docx in PowerShell Automate using Rest API:

    76223-snipaste-2021-03-10-15-57-50.png

    76231-snipaste-2021-03-10-15-58-32.png

    76212-snipaste-2021-03-10-15-59-20.png

    I suggest you could try to test set with a hard code value like above to see if it works.

    Thanks
    Best Regards


    If an Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  2. Grant 1 Reputation point
    2021-03-12T00:25:18.517+00:00

    I actually posted this question in the Power Automate forum too as I wasn't really sure if it was more SharePoint related (REST API) or Power Automate with the Action.

    A person in there came back with the solution which was to include the file extension after my concatenated name, and it then included the full version.

    https://powerusers.microsoft.com/t5/General-Power-Automate/Renaming-SharePoint-file-using-REST-API-with-Power-Automate-cuts/td-p/853435#M66862

    Thanks Jerry (here) too for providing the test to see if it would work with a manual value.


  3. ZhengyuGuo 10,586 Reputation points Moderator
    2021-03-17T06:35:24.66+00:00

    Hi @Grant ,

    Please remeber to accept as answer if the question has been resolved so that it could also help others in the forum who have the similiar question.

    Thanks
    Best Regards

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.