<?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>Issue with a!toJson function</title><link>https://community.appian.com/discussions/f/general/28124/issue-with-a-tojson-function</link><description>Hi All, 
 
 Input code: a!toJson( value: { test: { assuranceText: &amp;quot;Jag f&amp;#246;rs&amp;#228;krar att uppgifterna jag har l&amp;#228;mnat &amp;#228;r riktiga och bekr&amp;#228;ftar att jag har tagit del av informationen och villkoren ovan.\n\nDin ans&amp;#246;kan grundas p&amp;#229; automatiserad behandling av dina</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Issue with a!toJson function</title><link>https://community.appian.com/thread/109653?ContentTypeID=1</link><pubDate>Fri, 17 Mar 2023 17:59:08 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:b3bbe707-37f4-4946-b485-f7482f4812d9</guid><dc:creator>Richard Michaelis</dc:creator><description>&lt;p&gt;nice idea&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issue with a!toJson function</title><link>https://community.appian.com/thread/109652?ContentTypeID=1</link><pubDate>Fri, 17 Mar 2023 17:55:48 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:3eaaee90-2507-4d9f-a3d5-587415575860</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;The first thing i&amp;#39;d try is to pre-sanitize it so that a!toJson() treats the newlines like newlines:&lt;br /&gt;&lt;pre class="ui-code" data-mode="java"&gt;a!toJson(
  value: {
    test: {
      assuranceText: substitute(ri!input, &amp;quot;\n&amp;quot;, char(10))
    }
  },
  removenulloremptyfields: true()
)&lt;/pre&gt;&lt;br /&gt;&lt;img src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/11/pastedimage1679075805916v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issue with a!toJson function</title><link>https://community.appian.com/thread/109651?ContentTypeID=1</link><pubDate>Fri, 17 Mar 2023 17:51:03 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:a4703e75-9a36-43ca-8469-be8293b66e49</guid><dc:creator>manikumarc0208</dc:creator><description>&lt;p&gt;Hi Mike, the idea is in a json string we want to send &amp;quot;\n&amp;quot; in between the text so that other systems (built on different technology) will interpret it as new line and show the message with line breaks. so wanted to know how get the output from toJson(&amp;quot;\n&amp;quot;) as &amp;quot;\n&amp;quot; instead of &amp;quot;\\n&amp;quot;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issue with a!toJson function</title><link>https://community.appian.com/thread/109650?ContentTypeID=1</link><pubDate>Fri, 17 Mar 2023 17:40:05 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:9ca23f44-eeaf-4465-99db-caac93445822</guid><dc:creator>Richard Michaelis</dc:creator><description>&lt;p&gt;ah you mean backslash.&amp;nbsp;&lt;br /&gt;yeah i toJson will just convert the text you provide.&lt;br /&gt;So try to write the text with the line breaks according to appian reals instead of taking a JSON command and convert it to a JSON statement -&amp;gt; appian is not prepared to do that in my mind -&amp;gt; a string is expected. plain convertion.&lt;br /&gt;char(10) should perhaps to the trick?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issue with a!toJson function</title><link>https://community.appian.com/thread/109649?ContentTypeID=1</link><pubDate>Fri, 17 Mar 2023 17:36:33 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:049ab037-d664-4f9a-b678-4c70c98ea3ae</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;Your input doesn&amp;#39;t have &amp;quot;newline characters&amp;quot; as far as &lt;em&gt;a!toJson()&lt;/em&gt; is concerned, it just has the text &amp;quot;\n&amp;quot;. So when you call a!toJson() on your original string, it&amp;#39;s escaping your &amp;quot;\n&amp;quot; characters to &amp;quot;\\n&amp;quot;, because it has no way of knowing you don&amp;#39;t want it to preserve those as plaintext.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issue with a!toJson function</title><link>https://community.appian.com/thread/109648?ContentTypeID=1</link><pubDate>Fri, 17 Mar 2023 17:32:14 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:e4b69118-d719-461b-a790-527aef17494e</guid><dc:creator>manikumarc0208</dc:creator><description>&lt;p&gt;here I am expecting \n\n but in the output i am getting \\n\\n&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issue with a!toJson function</title><link>https://community.appian.com/thread/109646?ContentTypeID=1</link><pubDate>Fri, 17 Mar 2023 17:31:22 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:da6d710b-d69d-405b-b63d-0aab5ab5ded7</guid><dc:creator>manikumarc0208</dc:creator><description>&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/1425x49/__key/communityserver-discussions-components-files/11/pastedimage1679074300726v1.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issue with a!toJson function</title><link>https://community.appian.com/thread/109645?ContentTypeID=1</link><pubDate>Fri, 17 Mar 2023 17:28:12 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7c63a63e-d662-4d0e-b597-1eb20ecf70f1</guid><dc:creator>Richard Michaelis</dc:creator><description>&lt;p&gt;Hi Manikumar,&lt;br /&gt;can you mark the word you think is extra?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>