<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.appian.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>How to escape double quotes from the value of a JSON field</title><link>https://community.appian.com/discussions/f/general/11253/how-to-escape-double-quotes-from-the-value-of-a-json-field</link><description>Hi All, 
 We are getting data from Sharepoint using a!httpQuery in json format and then converting it to appian value using a!fromJson to use in the application. It all works fine except for the scenario where the value for a json field has some word</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: How to escape double quotes from the value of a JSON field</title><link>https://community.appian.com/thread/49561?ContentTypeID=1</link><pubDate>Fri, 20 Oct 2017 15:43:55 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7f22acfe-4f42-47cc-9022-41fc91d9e3dc</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;blockquote&gt;
&lt;p&gt;&amp;quot;We cannot restrict the source system, so we have to take care of it on our end.&amp;quot;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Are you saying that the unescaped text is coming from the DB and you have no control over it?&amp;nbsp; I don&amp;#39;t believe it&amp;#39;s valid JSON formatting in that case, and unless you&amp;#39;re able to cook up some sort of manual parser (checking for any double quotes not either right after a &amp;#39;:&amp;#39; or right before a &amp;#39;,&amp;#39; or EOL, then subbing them out for the escaped equivalent), you might not be able to work with it.&lt;/p&gt;
&lt;p&gt;Others here have pointed out that proper escaping of a double quote on JSON is a double-double-quote i.e. &amp;quot;&amp;quot;, however after testing it out in Appian, it looks like an escaped quote is \&amp;quot;.&amp;nbsp; You can try it yourself like this: &lt;a href="https://www.screencast.com/t/t3PYmFNaj"&gt;https://www.screencast.com/t/t3PYmFNaj&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to escape double quotes from the value of a JSON field</title><link>https://community.appian.com/thread/49559?ContentTypeID=1</link><pubDate>Fri, 20 Oct 2017 14:57:57 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:49231bef-487b-4233-b784-e9c6e695c5c4</guid><dc:creator>saboulnaga</dc:creator><description>This is the correct way of doing it.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to escape double quotes from the value of a JSON field</title><link>https://community.appian.com/thread/49486?ContentTypeID=1</link><pubDate>Tue, 17 Oct 2017 17:54:26 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:3089ef20-60b6-4020-b67f-543c77f5f8ef</guid><dc:creator>Puspendu Pal</dc:creator><description>The double quotes can be escaped by double double quotes:  &amp;quot;This is an &amp;quot;&amp;quot;example&amp;quot;&amp;quot; to show the issue&amp;quot;.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to escape double quotes from the value of a JSON field</title><link>https://community.appian.com/thread/49485?ContentTypeID=1</link><pubDate>Tue, 17 Oct 2017 17:18:01 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:9e82fa1a-f5eb-4523-b430-36b0fdc94113</guid><dc:creator>Carlos Santander</dc:creator><description>If you know the json fields ahead of time, you could preprocess the text before passing it to a!fromjson(). You could do a search to find &amp;quot;Title&amp;quot;, &amp;quot;Name&amp;quot;, and &amp;quot;Created&amp;quot;, then take the values in between the fields (&amp;quot;This is an &amp;quot;example&amp;quot; to show the issue&amp;quot;), and manually replace the quotation marks in the value. You would then feed the resulting strint to a!fromjson.&lt;br /&gt;
&lt;br /&gt;
I&amp;#39;m inclined to say that this is technically invalid json. You could use one of the many online validation tools out there to make a case that the source system makes a change because it&amp;#39;s generating invalid data.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to escape double quotes from the value of a JSON field</title><link>https://community.appian.com/thread/49474?ContentTypeID=1</link><pubDate>Tue, 17 Oct 2017 13:14:26 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:926e54b8-0650-40aa-8045-9b99f62992a7</guid><dc:creator>kiranj</dc:creator><description>Stripwith(local!appianvalue,&amp;quot;&amp;quot;) this will  remove the double quotes where local!appianvalue has your value which is converted from JSON to Appian&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to escape double quotes from the value of a JSON field</title><link>https://community.appian.com/thread/49461?ContentTypeID=1</link><pubDate>Tue, 17 Oct 2017 01:51:43 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:8393473f-1a38-40a1-9b9e-42c70a9b6b16</guid><dc:creator>Jamal Case</dc:creator><description>&lt;p&gt;You could use the stripwith() or cleanwith() functions to remove the double quotes. please refer to&amp;nbsp;&lt;a href="https://docs.appian.com/suite/help/17.3/fnc_text_cleanwith.html"&gt;https://docs.appian.com/suite/help/17.3/fnc_text_cleanwith.html&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://docs.appian.com/suite/help/17.3/fnc_text_stripwith.html"&gt;https://docs.appian.com/suite/help/17.3/fnc_text_stripwith.html&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>