Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Connectors
Unanswered

Renaming folder with "Send an HTTP Request to SharePoint" fails when there's a single quote character (%27)

(0) ShareShare
ReportReport
Posted on by 17

I'm using this guide: https://www.sharepointwidgets.com/2020/07/rename-folder-using-microsoft-flow.html

 

When the folder name i'm trying to rename has a single quote in it, it fails. I've tried adding a encodeUriComponent() to the variable resulting in the underlined string below, but it still fails. 

 

Error:

<?xml version="1.0" encoding="utf-8"?><m:error xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"><m:code>-1, Microsoft.SharePoint.Client.InvalidClientQueryException</m:code><m:message xml:lang="en-US">The expression "web/GetFolderByServerRelativeUrl('Shared Documents/General/TEST/Carlo's Test/FolderTemplate')/ListItemAllFields" is not valid.</m:message></m:error>
clientRequestId: 47034f39-9c02-4071-b076-03eb5956e9e9
serviceRequestId: fab5caa0-c0c2-3000-f88f-aa1419c79fe5

  • wskinnermctc Profile Picture
    6,517 Super User 2025 Season 1 on at
    Re: Renaming folder with "Send an HTTP Request to SharePoint" fails when there's a single quote character (%27)

    Months ago I remember trying to set up an HTTP request that could accommodate a SPList name with single quote. I was going to have the SPList name in a variable and then put it into the HTTP request.

     

    I wanted it to be an example other people could use no matter what the name of this list was set to.

     

    I tried and tried for hours to come up with a way to get it to work. I never could.

     

    I know that doesn't help, but my end conclusion was, "They shouldn't put those special characters in a list name". I would be thinking the same thing about folder names.

  • v-xiaochen-msft Profile Picture
    on at
    Re: Renaming folder with "Send an HTTP Request to SharePoint" fails when there's a single quote character (%27)

    Hi @carlom_iptech ,

     

    You can use double single quote to solve it.

    If your folder name is <Test1'Test2>, please try to use Test1''Test2 in the request url.

     

    Best Regards,

    Wearsky

  • carlom_iptech Profile Picture
    17 on at
    Re: Renaming folder with "Send an HTTP Request to SharePoint" fails when there's a single quote character (%27)

    Issue is when the original folder’s name has a single quote.

  • carlom_iptech Profile Picture
    17 on at
    Re: Renaming folder with "Send an HTTP Request to SharePoint" fails when there's a single quote character (%27)

    Issue is when the original folder’s name has a single quote.

  • v-xiaochen-msft Profile Picture
    on at
    Re: Renaming folder with "Send an HTTP Request to SharePoint" fails when there's a single quote character (%27)

    Hi @carlom_iptech ,

     

    Please try this

    vxiaochenmsft_0-1690510436372.png

    vxiaochenmsft_1-1690510451735.png

    {
    "Title": "C'D",
    "FileLeafRef": "C'D"
    }

    vxiaochenmsft_2-1690510477082.png

    vxiaochenmsft_3-1690510485365.png

     

    Best Regards,

    Wearsky

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

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 566 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 516 Super User 2025 Season 1

#3
stampcoin Profile Picture

stampcoin 492

Featured topics