web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Escape Single quote fr...
Power Automate
Unanswered

Escape Single quote from string

(2) ShareShare
ReportReport
Posted on by 84

Hi All,

I am creating folders in SharePoint using ms flows.  flowimage1.png

it works perfectly when "Output" does not have "single quote" in that. when there is single quote let say Output value is "CustomName'Test" it fails because of quote. 

 

how can I escape that single quote. I don't want to replace that single quote with blank or any other value. 

Categories:
I have the same question (0)
  • fchopo Profile Picture
    8,003 Moderator on at

    Hello @vaishalivyas1 

    Please, have a look at this post by @PieterVeenstra on handling apostrophes and single quotes in Flow: https://sharepains.com/2019/10/07/handling-apostrophes-in-microsoft-flow/

    Basically, you should insert a "\" character before the quote character, with the following expression: replace(outputs(),””,’\”’)

    Hope it helps!

    Ferran

     

  • yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    Hi @vaishalivyas1 

     

    You can also try this method: Intialize a variable with quote and enter value as a single quote and then use the expression below:

    ffre.PNG

     

    Expression: 

    replace(triggerBody()['text'],variables('quote'),'')
     
    Hope this Helps!
     
    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
  • lliu_western Profile Picture
    289 on at

    @yashag2255 

     

    this whole image is the return value I got:

    lliu_western_0-1607018037728.png

    by using this formula:

    lliu_western_1-1607018068674.png

    But I only need the highlighted text, how can I get the substring top at the first single quote it encounters? 

  • fchopo Profile Picture
    8,003 Moderator on at

    Hello @lliu_western 

    You could use the split function and getting the first element:

    first(split(your_expression,''''))

     

    Hope it helps!

    Ferran

  • zylantha Profile Picture
    6 on at

    This is an incomplete solution to the issue.  

     

    You should use encodeUriComponent() instead, which will encode all invalid characters - not just single quotes.

  • smarydas Profile Picture
    9 on at

    Thanks @zylantha ... It works...

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 503 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 321 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard