<?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 read only grid</title><link>https://community.appian.com/discussions/f/user-interface/28639/need-help-on-read-only-grid</link><description>Hi All, 
 
 I have added the sample code and the output where I need to display the corresponding status for that particular name. 
 for example: Name: Ajay Status should be Test1, Test2 and similarly 
 for Name: Kumar Status should be Test3 
 and for</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Need help on read only grid</title><link>https://community.appian.com/thread/112605?ContentTypeID=1</link><pubDate>Thu, 11 May 2023 17:31:20 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:69341ac8-941f-4343-a098-2c9b6995a242</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;Sanchit and Tejpals already gave you workable solutions above (and props to Harshit for pointing out that, really at this point everyone should be using a!localVariables for this...)&lt;/p&gt;
&lt;p&gt;But I wanted to chime in with a recommendation towards a usual approach of mine, which is to abstract complicated processing behind additional local variables when necessary.&amp;nbsp; In this case the idea is to construct a whole new array-of-maps that will contain the &amp;quot;Name&amp;quot; property as well as a pre-evaluated copy of the Statuses looked up from the predefined Status List, formatted cleanly and separated by a comma (just for example).&amp;nbsp; Then we just use that new local variable as the source for the grid; any changes made to the original data will cause this to auto-update too, so we should be good there.&lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/13/pastedimage1683826154180v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;One of the main draws to this approach is we don&amp;#39;t have to do potentially complex processing in the grid column itself (which isn&amp;#39;t always bad to do, but often will make it easier to understand the code in the future, among other things):&lt;br /&gt;&lt;img src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/13/pastedimage1683826264205v3.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;The entire code body isn&amp;#39;t much changed, other than the addition of the declaration for local!gridData:&lt;br /&gt;&lt;pre class="ui-code" data-mode="java"&gt;a!localVariables(
  local!empStatus: {
    { name: &amp;quot;Ajay&amp;quot;, status: &amp;quot;test1&amp;quot; },
    { name: &amp;quot;Ajay&amp;quot;, status: &amp;quot;test2&amp;quot; },
    { name: &amp;quot;kumar&amp;quot;, status: &amp;quot;test3&amp;quot; },
    { name: &amp;quot;phani&amp;quot;, status: &amp;quot;test4&amp;quot; }
  },
  local!empDetail: {
    { name: &amp;quot;Ajay&amp;quot; },
    { name: &amp;quot;kumar&amp;quot; },
    { name: &amp;quot;phani&amp;quot; }
  },
  
  local!gridData: a!forEach(
    local!empDetail,
    a!map(
      name: fv!item.name,
      statusList: joinarray(
        index(
          local!empStatus.status,
          wherecontains(fv!item.name, local!empStatus.name),
          {}
        ),
        &amp;quot;, &amp;quot;
      )
    )
  ),
  
  a!boxLayout(
    label: &amp;quot;Form&amp;quot;,
    contents: {
      a!gridField(
        label: &amp;quot;grid&amp;quot;,
        data: local!gridData,
        pageSize: 5,
        columns: {
          a!gridColumn(
            label: &amp;quot;Name&amp;quot;,
            sortField: &amp;quot;name&amp;quot;,
            value: fv!row.name
          ),
          a!gridColumn(
            label: &amp;quot;Status&amp;quot;,
            value: fv!row.statusList
          )
        }
      )
    }
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Need help on read only grid</title><link>https://community.appian.com/thread/112563?ContentTypeID=1</link><pubDate>Thu, 11 May 2023 08:58:44 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:1d283ea7-95f7-43b0-846e-22661daad375</guid><dc:creator>Shaik Gousi</dc:creator><description>&lt;p&gt;Sure Thank You!!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Need help on read only grid</title><link>https://community.appian.com/thread/112557?ContentTypeID=1</link><pubDate>Thu, 11 May 2023 07:20:18 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:cc094c8a-ea79-490e-9b9b-ca72a257bbd4</guid><dc:creator>Shaik Gousi</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: Need help on read only grid</title><link>https://community.appian.com/thread/112555?ContentTypeID=1</link><pubDate>Thu, 11 May 2023 07:08:51 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:ae073e2f-5eca-4840-99fe-daf6e2cc0ee8</guid><dc:creator>Harshit Bumb (Appyzie)</dc:creator><description>&lt;p&gt;Also, a couple of observations&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!forEach(
              items: local!empStatus,
              expression: fv!item.status
            )&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Here, forEach is not being used. It is useless. Rather you can just write local!empStatus.status.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;pagingSaveInto: fv!pagingInfo,&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;fv!pagingInfo gives you the current pagingInfo. You should use a variable instead that you are passing in your query as pagingInfo&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Need help on read only grid</title><link>https://community.appian.com/thread/112553?ContentTypeID=1</link><pubDate>Thu, 11 May 2023 06:11:35 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:2e1308b5-37b8-4c2f-9abf-eb9a119c7c77</guid><dc:creator>Harshit Bumb (Appyzie)</dc:creator><description>&lt;p&gt;Why are you still using load instead of localVariables?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Need help on read only grid</title><link>https://community.appian.com/thread/112550?ContentTypeID=1</link><pubDate>Thu, 11 May 2023 06:04:51 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:76ad5939-b3fe-4dbb-a2b7-6b282b5eaa5f</guid><dc:creator>sanchitg0002</dc:creator><description>&lt;p&gt;You can edit that as well&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " height="110" src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/13/pastedimage1683785067067v1.png" width="202" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Need help on read only grid</title><link>https://community.appian.com/thread/112549?ContentTypeID=1</link><pubDate>Thu, 11 May 2023 06:00:18 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:821d8e5d-2512-4a2a-846d-b1bada51255d</guid><dc:creator>tejpals0001</dc:creator><description>&lt;p&gt;okay thanks, next time I will.&lt;span class="emoticon" data-url="https://community.appian.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Need help on read only grid</title><link>https://community.appian.com/thread/112547?ContentTypeID=1</link><pubDate>Thu, 11 May 2023 05:57:52 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:98be85a8-52bd-4692-974a-2c6c23eec58d</guid><dc:creator>sanchitg0002</dc:creator><description>&lt;p&gt;It is more readable in a code box&lt;span class="emoticon" data-url="https://community.appian.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;img height="178" src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/13/pastedimage1683784675061v1.png" width="116" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Need help on read only grid</title><link>https://community.appian.com/thread/112544?ContentTypeID=1</link><pubDate>Thu, 11 May 2023 05:53:59 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:0052497a-8c0b-4b19-9d6f-f51be26513b9</guid><dc:creator>tejpals0001</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;load(
  local!empStatus: {
    { name: &amp;quot;Ajay&amp;quot;, status: &amp;quot;test1&amp;quot; },
    { name: &amp;quot;Ajay&amp;quot;, status: &amp;quot;test2&amp;quot; },
    { name: &amp;quot;kumar&amp;quot;, status: &amp;quot;test3&amp;quot; },
    { name: &amp;quot;phani&amp;quot;, status: &amp;quot;test4&amp;quot; }
  },
  local!empDetail: {
    { name: &amp;quot;Ajay&amp;quot; },
    { name: &amp;quot;kumar&amp;quot; },
    { name: &amp;quot;phani&amp;quot; }
  },
  a!boxLayout(
    label: &amp;quot;Form&amp;quot;,
    contents: {
      a!gridField(
        label: &amp;quot;grid&amp;quot;,
        data: local!empDetail,
        pageSize: 5,
        pagingSaveInto: fv!pagingInfo,
        columns: {
          a!gridColumn(label: &amp;quot;Name&amp;quot;, value: fv!row.name),
          a!gridColumn(
            label: &amp;quot;Status&amp;quot;,
            value: a!forEach(
              items: local!empStatus,
              expression:   if(fv!row.name=fv!item.name,fv!item.status,{})
            )
          
          )
        }
      )
    }
  )
)&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Need help on read only grid</title><link>https://community.appian.com/thread/112540?ContentTypeID=1</link><pubDate>Thu, 11 May 2023 05:48:48 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:677609b1-6cf6-4f73-9ecb-b41bed2e10c4</guid><dc:creator>Shaik Gousi</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: Need help on read only grid</title><link>https://community.appian.com/thread/112538?ContentTypeID=1</link><pubDate>Thu, 11 May 2023 05:44:33 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:a2a4b288-e7e3-4ca1-a96c-3fbd23442d23</guid><dc:creator>sanchitg0002</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="java"&gt;load(
  local!empStatus: {
    { name: &amp;quot;Ajay&amp;quot;, status: &amp;quot;test1&amp;quot; },
    { name: &amp;quot;Ajay&amp;quot;, status: &amp;quot;test2&amp;quot; },
    { name: &amp;quot;kumar&amp;quot;, status: &amp;quot;test3&amp;quot; },
    { name: &amp;quot;phani&amp;quot;, status: &amp;quot;test4&amp;quot; }
  },
  local!empDetail: {
    { name: &amp;quot;Ajay&amp;quot; },
    { name: &amp;quot;kumar&amp;quot; },
    { name: &amp;quot;phani&amp;quot; }
  },
  a!boxLayout(
    label: &amp;quot;Form&amp;quot;,
    contents: {
      a!gridField(
        label: &amp;quot;grid&amp;quot;,
        data: local!empDetail,
        pageSize: 5,
        pagingSaveInto: fv!pagingInfo,
        columns: {
          a!gridColumn(label: &amp;quot;Name&amp;quot;, value: fv!row.name),
          a!gridColumn(
            label: &amp;quot;Status&amp;quot;,
            value: joinarray(
              index(
                local!empStatus.status,
                wherecontains(
                  fv!row.name,
                  touniformstring(local!empStatus.name)
                ),
                {}
              ),
              &amp;quot;,&amp;quot;
            )
          )
        }
      )
    }
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>