cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
vaishalivyas1
Helper III
Helper III

Escape Single quote from string

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. 

4 REPLIES 4
fchopo
Super User II
Super User II

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

 

Did I answer your question? Please consider to mark my post as a solution to help others.
Proud to be a Flownaut!
yashag2255
Dual Super User II
Dual Super User II

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!

@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? 

Hello @lliu_western 

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

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

 

Hope it helps!

Ferran

Did I answer your question? Please consider to mark my post as a solution to help others.
Proud to be a Flownaut!

Helpful resources

Announcements
MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Users online (48,302)