<?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>Handling Special Characters in Rich Text Items in Appian</title><link>https://community.appian.com/discussions/f/general/39035/handling-special-characters-in-rich-text-items-in-appian</link><description>When working with rich text components in Appian, I encountered issues with displaying special characters correctly, particularly backslashes ( \ ) and other escape characters like tabs ( \t ) and newlines ( \n ). These characters can be misinterpreted</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Handling Special Characters in Rich Text Items in Appian</title><link>https://community.appian.com/thread/147728?ContentTypeID=1</link><pubDate>Fri, 02 May 2025 10:43:42 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:ad6308d3-27a8-4516-b914-efb4d1b9ea7d</guid><dc:creator>Harsha Sharma</dc:creator><description>&lt;p&gt;Overall the issue doesn&amp;#39;t lie with rich text field with respect to handling special characters. Your use case is peculiar because the response you are working with is using same characters within file path as well as before or after the paths. There is a lack of pattern in the data basis my understanding so far.&lt;/p&gt;
&lt;p&gt;To work with this sort of data you definitely need to structure your data somehow. May be you can find a character set which can help split the paths with other texts. Then you can leave the paths as is and just perform operation on the other text strings.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Without a unique pattern identification system wont be able to keep some \n, \t and strip out others. It will either keep them all or remove them all. So identifying a pattern should be first step to conditionally handle these characters.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Handling Special Characters in Rich Text Items in Appian</title><link>https://community.appian.com/thread/147726?ContentTypeID=1</link><pubDate>Fri, 02 May 2025 09:29:20 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:46d9f66c-3f09-4f61-9cd7-743d190437c4</guid><dc:creator>Aamir</dc:creator><description>&lt;p&gt;For the questions&lt;br /&gt;&lt;br /&gt;&lt;span&gt;Yes, the API is returning the file path entirely in this format.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The API is returning around 10,000+ character texts, and in those, there are multiple t and n, as well as the file paths,&amp;nbsp;so I have only mentioned the file path example.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;But there is no fixed word before a file path,&amp;nbsp;&lt;span&gt;&amp;quot;File Path:&amp;quot; will not always be there.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Handling Special Characters in Rich Text Items in Appian</title><link>https://community.appian.com/thread/147717?ContentTypeID=1</link><pubDate>Fri, 02 May 2025 07:15:05 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:1dad7427-7843-4c3e-9ef5-b7bd55eca3f6</guid><dc:creator>Harsha Sharma</dc:creator><description>&lt;p&gt;Few questions:&lt;/p&gt;
&lt;p&gt;1. In the Actual/Expected output above - looks like you want to subjectively handle \n, \t etc.&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; The expected output shows \t and \n in the string&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; File Path: C:\Users&lt;strong&gt;\t&lt;/strong&gt;UserXyz\Documents\Project\file.txt&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; Another File Path: &lt;span&gt;C:\Users&lt;strong&gt;\n&lt;/strong&gt;UserXyz\Documentseporteport.txt&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp;So my understanding is these are expected in the directory path but not before and after.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp;Do you want to remove just the highlighted ones from ri!inputText?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp;&amp;quot;File Path:&lt;strong&gt;\n&lt;/strong&gt;C:\Users\tUserXyz\Documents\Project\file.txt&lt;strong&gt;\t&lt;/strong&gt;AnotherPath:&lt;strong&gt;\n&lt;/strong&gt;C:\Users\nUserXyz\Documents\Report\report.txt&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;2. You mentioned API sends the file path. Can you elaborate on any operation you are doing on the API response to achieve this&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;inputText or API is returning the file path entirely in this format&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;quot;File Path:\nC:\Users\tUserXyz\Documents\Project\file.txt\tAnotherPath:\nC:\Users\nUserXyz\Documents\Report\report.txt&amp;quot;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Handling Special Characters in Rich Text Items in Appian</title><link>https://community.appian.com/thread/147667?ContentTypeID=1</link><pubDate>Wed, 30 Apr 2025 13:03:30 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:6637ef2c-b48c-4597-83e7-53232406b2e3</guid><dc:creator>Aamir</dc:creator><description>&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="/resized-image/__size/640x480/__key/communityserver-discussions-components-files/11/pastedimage1746018183432v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Raw output is as follows&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Handling Special Characters in Rich Text Items in Appian</title><link>https://community.appian.com/thread/147666?ContentTypeID=1</link><pubDate>Wed, 30 Apr 2025 13:00:50 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:4c4a1790-e620-4152-aeab-aa735afbc4b6</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;Switch to &amp;quot;Raw&amp;quot; in the test output.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Handling Special Characters in Rich Text Items in Appian</title><link>https://community.appian.com/thread/147664?ContentTypeID=1</link><pubDate>Wed, 30 Apr 2025 12:56:28 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:b8b06eb3-34fe-4f01-b892-40f64cf7745b</guid><dc:creator>Aamir</dc:creator><description>&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="/resized-image/__size/640x480/__key/communityserver-discussions-components-files/11/pastedimage1746017480325v1.png" /&gt;&lt;br /&gt;&lt;br /&gt;I am still getting the issue.&lt;br /&gt;&lt;br /&gt;&lt;span&gt;&lt;span class="CollapsibleOutputNode---print_value"&gt;Actual Output: &amp;quot;File Path: C:\Users UserXyz\Documents\Project\file.txt AnotherPath: C:\Users UserXyz\Documentseporteport.txt&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;span class="CollapsibleOutputNode---print_value"&gt;Expected Output:&amp;nbsp;&amp;quot;File Path: C:\Users\tUserXyz\Documents\Project\file.txt AnotherPath: C:\Users\nUserXyz\Documentseporteport.txt&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Handling Special Characters in Rich Text Items in Appian</title><link>https://community.appian.com/thread/147663?ContentTypeID=1</link><pubDate>Wed, 30 Apr 2025 12:49:42 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:e547a4e4-0ef4-41f6-aab5-152214eafed4</guid><dc:creator>Aamir</dc:creator><description>&lt;p&gt;I have updated the string&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Handling Special Characters in Rich Text Items in Appian</title><link>https://community.appian.com/thread/147661?ContentTypeID=1</link><pubDate>Wed, 30 Apr 2025 12:41:48 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:683a5188-d9d3-4aaf-9fe7-9c8d932af950</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;There is a &amp;quot;more simple&amp;quot; approach to substituting multiple items in a string.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!text: &amp;quot;File Path:\nC:\Users\tUserXyz\Documents\Project\file.txt\tAnotherPath:\nC:\Users\NUserXyz\Documents\Report\report.txt&amp;quot;,
  reduce(
    substitute(_,_,_),
    local!text,
    merge(
      {&amp;quot;\n&amp;quot;, &amp;quot;\N&amp;quot;, &amp;quot;\t&amp;quot;, &amp;quot;\T&amp;quot;, &amp;quot;\\&amp;quot;, &amp;quot;\r&amp;quot;, &amp;quot;\R&amp;quot;},
      {char(10), char(10), char(9), char(9), char(92), &amp;quot;&amp;quot;, &amp;quot;&amp;quot;}
    )
  )
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This uses the two arrays inside merge() to substitute the first item in the first array with the first item in the second array and so forth. I suggest to read the documentation on the functions reduce() and merge(), and also read the section around partial evaluation&lt;/p&gt;
&lt;p&gt;&lt;a href="https://docs.appian.com/suite/help/25.1/expression-advanced-evaluation.html#partial-evaluation-of-rules-and-type-constructors"&gt;docs.appian.com/.../expression-advanced-evaluation.html&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Handling Special Characters in Rich Text Items in Appian</title><link>https://community.appian.com/thread/147656?ContentTypeID=1</link><pubDate>Wed, 30 Apr 2025 12:26:58 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:4a776752-7b1f-4fd0-9aa7-185c213b8814</guid><dc:creator>Harsha Sharma</dc:creator><description>&lt;p&gt;I attempted the scenario as is and its working for me. \n, \t all are visible appropriately in the rich text display field. May be just check if the variable you are passing in the richtextitem() is having file path as intented or not.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="/resized-image/__size/640x480/__key/communityserver-discussions-components-files/11/pastedimage1746015930451v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>