<?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>Representing a local variable with an array of text in a grid view</title><link>https://community.appian.com/discussions/f/general/34503/representing-a-local-variable-with-an-array-of-text-in-a-grid-view</link><description>Hello, I have a local variable that contains an array of text retrieved from an API Call as seen below: 
 
 so let&amp;#39;s assume for example that i have 5 items in my transactionlist, each with their own id, time and amount, how can I represent each item accordingly</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Representing a local variable with an array of text in a grid view</title><link>https://community.appian.com/thread/132294?ContentTypeID=1</link><pubDate>Mon, 01 Apr 2024 18:04:13 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:d208246c-5f56-4972-8770-750fabb292c0</guid><dc:creator>Karumuru Abhishek</dc:creator><description>&lt;p&gt;Could you try this code and let me know.&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!data:{
 a!map(id: 1,
    time: &amp;quot;Time test&amp;quot;,
    amount:100),
    a!map(id:2,
    time: &amp;quot;Time test2&amp;quot;,
    amount: 200),
  },
  {
    a!gridField(
      label: &amp;quot;Read-only Grid&amp;quot;,
      labelPosition: &amp;quot;ABOVE&amp;quot;,
      data:local!data,
      columns: {
        a!gridColumn(
          label: &amp;quot;id&amp;quot;,
          value: fv!row.id
        ),
        a!gridColumn(
          label: &amp;quot;Data&amp;quot;,
          value: a!richTextDisplayField(
            value: {
              a!richTextItem(
                text: &amp;quot;time&amp;quot;
              ),
              concat(&amp;quot; &amp;quot;,&amp;quot;:&amp;quot;,&amp;quot; &amp;quot;),
              a!richTextItem(
              text: fv!row.time
            ),
             repeat(2,char(32)),
             concat(&amp;quot;,&amp;quot;,&amp;quot; &amp;quot;),
             a!richTextItem(
               text: &amp;quot;amount&amp;quot;
             ),
             concat(&amp;quot; &amp;quot;,&amp;quot;:&amp;quot;,&amp;quot; &amp;quot;),
             a!richTextItem(
               text: fv!row.amount,
             ),
             repeat(2,char(32))
             
            }
          )
        )
      },
      validations: {}
    )
  }
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Representing a local variable with an array of text in a grid view</title><link>https://community.appian.com/thread/132282?ContentTypeID=1</link><pubDate>Mon, 01 Apr 2024 15:39:15 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:c2efd1b2-caf2-48a3-818f-ee1a8d7fa440</guid><dc:creator>Shubham Aware</dc:creator><description>&lt;p&gt;&amp;nbsp;&lt;a href="/members/mohamedz4875"&gt;mohamedz4875&lt;/a&gt;&amp;nbsp;&lt;br /&gt;You&amp;#39;re on the right track! To display each item in your local!transactionList as a separate row in the grid view, you can leverage the a!foreach function within the data property of the a!gridField.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Representing a local variable with an array of text in a grid view</title><link>https://community.appian.com/thread/132268?ContentTypeID=1</link><pubDate>Mon, 01 Apr 2024 13:37:21 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:1948f587-1dfa-480f-a492-9ddf80497664</guid><dc:creator>daisyMSingh</dc:creator><description>&lt;p&gt;Try Using this Approach as it Will Give Clarity and Control Over What you are trying to implement.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!gridField(
  label: &amp;quot;List of Transactions&amp;quot;,
  labelPosition: &amp;quot;ABOVE&amp;quot;,
  data: {
    { id: 1, time: { now(), now() + 1, now() + 2 } },
    { id: 2, time: { now(), now() + 1, now() + 2 } }
  },
  columns: {
    a!gridColumn(label: &amp;quot;Id&amp;quot;, value: fv!row.id),
    a!gridColumn(label: &amp;quot;Time&amp;quot;, value: a!richTextDisplayField(value: a!richTextBulletedList(items: fv!row.time)))
  },
  validations: {},
  selectable: true
),&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Representing a local variable with an array of text in a grid view</title><link>https://community.appian.com/thread/132212?ContentTypeID=1</link><pubDate>Sun, 31 Mar 2024 07:21:07 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:47c54833-86c7-4328-b5fe-0b728ecf871c</guid><dc:creator>mohamedz4875</dc:creator><description>&lt;p&gt;Yes this is almost what I am trying to do, basically I want one column for each Id, time and amount.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Representing a local variable with an array of text in a grid view</title><link>https://community.appian.com/thread/132026?ContentTypeID=1</link><pubDate>Thu, 28 Mar 2024 13:27:06 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7a94169b-420e-4579-b51d-b45f93e8d778</guid><dc:creator>David Jimenez </dc:creator><description>&lt;p&gt;I assume that you are receiving the information in that format from the Api. In that case I would suggest to work with that data, in order to transform it in a dictionary, map or just use split or create an array.&lt;/p&gt;
&lt;p&gt;Could you post the data in the format you are receiving it from the api please?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Representing a local variable with an array of text in a grid view</title><link>https://community.appian.com/thread/132024?ContentTypeID=1</link><pubDate>Thu, 28 Mar 2024 13:03:31 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:1b9cf634-43e7-4b96-91c1-18de2ab3defd</guid><dc:creator>Karumuru Abhishek</dc:creator><description>&lt;p&gt;hi&amp;nbsp;&lt;a href="/members/mohamedz4875"&gt;mohamedz4875&lt;/a&gt;&amp;nbsp;do you want to display,&amp;nbsp; &amp;quot;ID&amp;quot;, in one column and remaining, time and amount in the next column?&lt;/p&gt;
&lt;p&gt;is it something like this ?&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/pastedimage1711631055245v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>