<?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>array to text</title><link>https://community.appian.com/discussions/f/general/23577/array-to-text</link><description>Team, 
 I have below code : 
 a!localVariables( local!data1:{&amp;quot;test1&amp;lt;br&amp;gt;&amp;quot;,&amp;quot;test2&amp;lt;br&amp;gt;&amp;quot;}, local!data1 ) 
 Output is list of text strings 
 
 &amp;quot;test1&amp;lt;br&amp;gt;&amp;quot; (Text) 
 
 
 &amp;quot;test2&amp;lt;br&amp;gt;&amp;quot; (Text) 
 
 I want the output to be in format &amp;quot;tetst1&amp;lt;br&amp;gt;test2&amp;lt;br&amp;gt;&amp;quot; 
 
 Basically</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: array to text</title><link>https://community.appian.com/thread/90396?ContentTypeID=1</link><pubDate>Mon, 31 Jan 2022 15:45:07 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:e128248a-663c-4f69-aac6-f7f09ffabe48</guid><dc:creator>gauravp712</dc:creator><description>&lt;p&gt;Thank you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: array to text</title><link>https://community.appian.com/thread/90395?ContentTypeID=1</link><pubDate>Mon, 31 Jan 2022 15:44:55 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:c0cf31af-fba8-4ea9-a775-f319347300f0</guid><dc:creator>gauravp712</dc:creator><description>&lt;p&gt;Thank you , It worked.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: array to text</title><link>https://community.appian.com/thread/90394?ContentTypeID=1</link><pubDate>Mon, 31 Jan 2022 15:31:33 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:391dad6c-f9ba-4fab-a044-99a055770f06</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;yeah, any extra complexity and you need to know how to do a!forEach() with use of fv!isLast (etc), though for this case I felt like that was putting the cart before the horse a bit ;-)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: array to text</title><link>https://community.appian.com/thread/90393?ContentTypeID=1</link><pubDate>Mon, 31 Jan 2022 15:23:31 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:dac23629-925e-4c38-acd2-d183c5d13de8</guid><dc:creator>Stewart Burchell</dc:creator><description>&lt;p&gt;...actually, I take that back - joinarray() only inserts the separator between the elements of the array, so no extra char(10) at the end...so yours is indeed the less verbose solution.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: array to text</title><link>https://community.appian.com/thread/90392?ContentTypeID=1</link><pubDate>Mon, 31 Jan 2022 15:17:57 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:a34eda9a-8e84-4290-8bed-877f73bf8083</guid><dc:creator>Stewart Burchell</dc:creator><description>&lt;p&gt;You&amp;#39;ll get an extra char(10) in your code, which, in the scheme of things, may not be a big deal. I was trying to provide illustrations, not&amp;nbsp;definitive solutions.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: array to text</title><link>https://community.appian.com/thread/90391?ContentTypeID=1</link><pubDate>Mon, 31 Jan 2022 15:07:08 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:56b4d00d-31b2-4c1c-b7d6-3526a5d26baf</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;Maybe it&amp;#39;s just me, but this seems like a lot of extra run-around compared to `&lt;code&gt;joinarray(local!list, char(10))&lt;/code&gt;` which is equivalent.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/11/pastedimage1643641558078v1.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: array to text</title><link>https://community.appian.com/thread/90389?ContentTypeID=1</link><pubDate>Mon, 31 Jan 2022 15:03:52 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:46149764-ff08-459f-af21-207f2b324bc1</guid><dc:creator>Stewart Burchell</dc:creator><description>&lt;p&gt;In answer to your first question you can use fn!joinarray():&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;fn!joinarray(
  a!localVariables(
    local!data1: { &amp;quot;test1&amp;lt;br&amp;gt;&amp;quot;, &amp;quot;test2&amp;lt;br&amp;gt;&amp;quot; },
    local!data1
  )
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;If you want to have the output actually on separate lines (as is indicated by your second question) then you can loop through your input items and append a &amp;quot;new line&amp;quot; Unicode character to all items except the last item:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!myList: { &amp;quot;Test1&amp;quot;, &amp;quot;Test 2&amp;quot;, &amp;quot;Test 3&amp;quot; },
  local!myResult: fn!joinarray(
    a!forEach(
      items: local!myList,
      expression: if(
        fv!isLast,
        fv!item,
        concat(fv!item, char(10))
      )
    )
  ),
  { a!paragraphField(value: local!myResult) }
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: array to text</title><link>https://community.appian.com/thread/90388?ContentTypeID=1</link><pubDate>Mon, 31 Jan 2022 15:02:27 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:20d75a21-f6ee-4f6f-813a-e69719829a31</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="java"&gt;a!localVariables(
  local!data1:{&amp;quot;test1&amp;lt;br&amp;gt;&amp;quot;, &amp;quot;test2&amp;lt;br&amp;gt;&amp;quot;},
  joinArray(local!data1, char(10))
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;will result in:&lt;/p&gt;
&lt;p&gt;test1&amp;lt;br&amp;gt;&lt;br /&gt;test2&amp;lt;br&amp;gt;&lt;/p&gt;
&lt;p&gt;To get rid of the HTML break tags you will need to do a subsequent line-by-line command such as stripHtml(), though I don&amp;#39;t presume to know exactly what you&amp;#39;re hoping to have happen with HTML formatting in your input text.&amp;nbsp; FYI appian won&amp;#39;t format HTML as rich text without some pretty significant user-defined parsing, etc, which gets pretty complicated to set up.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>