cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Continued Contributor
Continued Contributor

Double Quotes

So I thought I had solved my issue with double quotes.  It is very easy to replace with the escape identifiers I need.

 

so: 

replace(variable, '"','\"')

 

This results in valid JSON.

 

But Flow is still saying it is an invalid character.  I finally narrowed it down by getting rid of everything else.

 

What I don't understand is why Flow would complain but no JSON validator programs complain.

 

What I think is happening is Flow needs single quotes around double quotes (but single quotes also need to be escaped) or I did find one thing about adaptive cards that might be similar.  Someone posted that they had to do the adaptive card like this:

 

"Test" as

 

"\"Test\""

 

So I started thinking, how to write this replace in Flow?

 

Looks like it puts the escape characters in but then puts double quotes around that, in flow that would be single quotes I think.

 

So:

 

'\"Test\"'

 

But how do I know where a quoted word starts and ends in order to wrap in single quotes?

 

And in JSON would I have to then escape the single quotes to?

 

So does someone know:

- In JSON in Flow say in a body of a "Send an HTTP request to SharePoint" action, how would I put a quoted word in there?

 

Thanks,

Terry

 

PS - I use a compose ahead of the HTTP request to do the "Replaces".. so I wonder if Flow is automatically doing something else behind the scenes?

 

5 REPLIES 5
Highlighted
Dual Super User
Dual Super User

Re: Double Quotes

Hi @Mattw112IG 

 

With adaptive cards, I have seen this issue when I directly copied the JSON from the card editor. However, if you initialize a variable of type object and assign the value to it instead of doing a compose, it should work. And if not, you might have to escape all spaces and enter keys as well for this to work. 

 

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!

Highlighted
Continued Contributor
Continued Contributor

Re: Double Quotes

I just tested.

 

I initialized and set a variable of type object with my text that includes a double quoted word.  "Test".

 

Then tried adding that variable to my body of the HTTP Request.

 

It wouldn't allow me to add it.  Doesn't even show up as an option to choose from.

 

So I changed it's type to string and then it allowed me to add it.  I then tested that and it still failed.

 

Terry

 

PS - I am escaping everything else fine, like new lines.  Only seems to have troubles with the double quotes.  Even though I am escaping them correctly \"  Flow still wants '\"Test\"'

 

 

Dual Super User
Dual Super User

Re: Double Quotes

Hi @Mattw112IG 

 

Can you post a screenshot of the flow? 

 

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!

Highlighted
Community Support
Community Support

Re: Double Quotes

Hi @Mattw112IG,

 

If you want to add quotes into the "Send an HTTP request to SharePoint" action, use "\"Test\"" will be correct:

Annotation 2020-05-25 142758.jpg

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Highlighted
Continued Contributor
Continued Contributor

Re: Double Quotes

yep I know this would be correct...

 

So, how do I do that in a flow?

 

Take a quoted word and escape it correctly?

 

I can't just say replace " with \"  because it wants the quotes in different places on the front and back end of the quoted word.

 

So you have to know what is the first " and replace that with "\" and what is the last " and replace with \""

 

Terry

Helpful resources

Announcements
firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

Join the new Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Top Kudoed Authors
Users online (7,940)