<?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>Need help on how to display all the rows of a column</title><link>https://community.appian.com/discussions/f/new-to-appian/21311/need-help-on-how-to-display-all-the-rows-of-a-column</link><description>Hi, 
 I have a DB table which has two columns,that is, ID and VALUE columns 
 And there are 5 rows. 
 My requirement is how to display ( Value Columns) different values in five rich texts as their names. 
 
 Thanks 
 Faisal</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Need help on how to display all the rows of a column</title><link>https://community.appian.com/thread/83108?ContentTypeID=1</link><pubDate>Tue, 29 Jun 2021 14:07:18 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:adb714e0-a205-46a1-8b23-e0e677d861d3</guid><dc:creator>Mike Schmitt</dc:creator><description>[quote userid="26843" url="~/discussions/f/new-to-appian/21311/need-help-on-how-to-display-all-the-rows-of-a-column/83106#83106"]but index() also does numerical indexes.[/quote]
&lt;p&gt;technically both functions do, but as strongly as i harp about using only &lt;em&gt;property()&lt;/em&gt; to get properties, i say the same about only using &lt;em&gt;index()&lt;/em&gt; to get indexes.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Need help on how to display all the rows of a column</title><link>https://community.appian.com/thread/83107?ContentTypeID=1</link><pubDate>Tue, 29 Jun 2021 14:04:15 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:662f77f5-fae6-473e-b047-f8162d7b2021</guid><dc:creator>faisalf0003</dc:creator><description>&lt;p&gt;Thank you very much David&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Need help on how to display all the rows of a column</title><link>https://community.appian.com/thread/83106?ContentTypeID=1</link><pubDate>Tue, 29 Jun 2021 13:40:29 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:2c470f94-8a26-4689-b3fe-7c35a77db53c</guid><dc:creator>davel001150</dc:creator><description>&lt;p&gt;I think this can be very, very easy.&lt;/p&gt;
&lt;p&gt;index() and property() both do the same thing, but index() also does numerical indexes.&lt;/p&gt;
&lt;p&gt;property(local!cdt, &amp;quot;value&amp;quot;, {})&amp;nbsp;returns the &amp;quot;value&amp;quot; column of a single local!cdt.&amp;nbsp; It returns an array of &amp;quot;value&amp;quot;s if local!cdt is an array.&amp;nbsp; Same for index().&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;local!cdt: {{id: 1, value: &amp;quot;A&amp;quot;}, {id:2, value: &amp;quot;B&amp;quot;}, {id:3, value: &amp;quot;C&amp;quot;}},
index(local!cdt, &amp;quot;value&amp;quot;, {})&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Should return {&amp;quot;A&amp;quot;, &amp;quot;B&amp;quot;, &amp;quot;C&amp;quot;}&amp;nbsp; No looping required; property() and index() should both automatically loop for you.&lt;/p&gt;
&lt;p&gt;Once you have 5 text strings, just a!forEach( items: local!textStrings, expression: richText(....text: fv!item, ....))&lt;/p&gt;
&lt;p&gt;If you need to combine elements, gather your CDT in a local like you&amp;#39;re doing now,&amp;nbsp;then a!forEach( items: local!CDTData, expression: richText( . . . text: property(fv!item, &amp;quot;name&amp;quot;, {}) &amp;amp; property(fv!item, &amp;quot;someOtherField&amp;quot;), ....))&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Need help on how to display all the rows of a column</title><link>https://community.appian.com/thread/83102?ContentTypeID=1</link><pubDate>Tue, 29 Jun 2021 13:10:31 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:93c109bc-b0db-44e0-87ef-9e773cf178c4</guid><dc:creator>Mike Schmitt</dc:creator><description>[quote userid="62125" url="~/discussions/f/new-to-appian/21311/need-help-on-how-to-display-all-the-rows-of-a-column/83099#83099"]a!forEach(items: local!empData,&lt;br /&gt; expression: fv!item.emptype)[1],[/quote]
&lt;p&gt;I&amp;#39;m not really sure what you&amp;#39;re trying to do here, but this specific piece of code will manually index the first ([1]) result of the array generated by the a!forEach() loop, basically making it meaningless.&amp;nbsp; I think it might be closer to your desired end result just by removing the &amp;quot;[1]&amp;quot;.&lt;/p&gt;
&lt;p&gt;Also: for code like this (or any SAIL or expression code really) I strongly suggest inserting your code into a Code Box (&amp;quot;Insert&amp;quot; --&amp;gt; &amp;quot;Insert Code&amp;quot; in the in-editor menu here), as this retains formatting like indentation and uses an easier font for reading code.&amp;nbsp; When asking others to review your code it&amp;#39;s a good idea to make it as easy to read as you can.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Need help on how to display all the rows of a column</title><link>https://community.appian.com/thread/83099?ContentTypeID=1</link><pubDate>Tue, 29 Jun 2021 09:55:25 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:fe7d98e7-257c-45b1-8f30-ceaa11e4975c</guid><dc:creator>faisalf0003</dc:creator><description>&lt;p&gt;I am using the below codes..It is ok?&lt;/p&gt;
&lt;p&gt;a!localVariables(&lt;br /&gt; local!empData:rule!FF_EMP_QE_EmpType(typeId: null),&lt;br /&gt; {a!columnsLayout(&lt;br /&gt; columns: {&lt;br /&gt; a!columnLayout(&lt;br /&gt; contents: {&lt;br /&gt; a!cardLayout(&lt;br /&gt; contents: a!richTextDisplayField(&lt;br /&gt; value: {&lt;br /&gt; a!richTextIcon(&lt;br /&gt; icon: &amp;quot;money&amp;quot;,&lt;br /&gt; color: &amp;quot;ACCENT&amp;quot;,&lt;br /&gt; size: &amp;quot;LARGE&amp;quot;&lt;br /&gt; ),&lt;br /&gt; char(10),&lt;br /&gt; a!richTextItem(&lt;br /&gt; text: a!forEach(items: local!empData,&lt;br /&gt; expression: fv!item.emptype)[1],&lt;br /&gt; /*text: local!empData[1].emptype*/&lt;/p&gt;
&lt;p&gt;size: &amp;quot;LARGE&amp;quot;)&lt;/p&gt;
&lt;p&gt;},&lt;br /&gt; align: &amp;quot;CENTER&amp;quot;&lt;br /&gt; ),&lt;br /&gt; /* Setting this variable would be used to navigate to a category of answers */&lt;br /&gt; /*link: a!dynamicLink(saveInto: a!save(local!category, &amp;quot;Finance&amp;quot;)),*/&lt;br /&gt; height: &amp;quot;AUTO&amp;quot;,&lt;br /&gt; marginBelow: &amp;quot;STANDARD&amp;quot;&lt;br /&gt; )})})})&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>