<?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>Showing data in a grid</title><link>https://community.appian.com/discussions/f/rules/21899/showing-data-in-a-grid</link><description>Hi All, I have a requirment in my Interface that I am displaying the data in a grid through Expression rule . But in that there are some fields like say isA , isB and isC &amp;#160;with 0 and 1 value in database . But now the The condition is that I have to show</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Showing data in a grid</title><link>https://community.appian.com/thread/85800?ContentTypeID=1</link><pubDate>Thu, 16 Sep 2021 01:45:32 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f341e80c-c7d4-432d-b66c-e3e73562b699</guid><dc:creator>Acacio Barrado</dc:creator><description>&lt;p&gt;Hey Saurabh,&lt;/p&gt;
&lt;p&gt;Yes it will work, if you use the code that I send as an example you can see that the values are changing in the grid according to the scenario that you select, in your case you just need to to the data transformation.&lt;/p&gt;
&lt;p&gt;If you have more doubts of how to adjust the example to your code, perhaps you can share part of your code and we can try to help.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Acacio B&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Showing data in a grid</title><link>https://community.appian.com/thread/85799?ContentTypeID=1</link><pubDate>Thu, 16 Sep 2021 01:24:34 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:84064f22-019a-4077-a619-7f50280b3038</guid><dc:creator>saurabh sharma</dc:creator><description>&lt;p&gt;Hi Acacio, &lt;/p&gt;
&lt;p&gt;I have to show the respective yes , no , n/a in respective columns in the grid . Will it work for the same &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Showing data in a grid</title><link>https://community.appian.com/thread/85796?ContentTypeID=1</link><pubDate>Thu, 16 Sep 2021 01:06:49 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:4f6c2238-cef0-4e97-baf3-8628e25a23b0</guid><dc:creator>Acacio Barrado</dc:creator><description>&lt;p&gt;Hi &lt;a href="/members/saurabhs0003"&gt;saurabh sharma&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;You will be able to achieve your solution in many different ways, please refer to the code below as it can give you some ideas, and than you can improve and adjust for your scenario.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!dataFromDb: {
    a!map(scenario: 1, isA: 0, isB: 1, isC: 1, colour: &amp;quot;#3498db&amp;quot;),
    a!map(scenario: 2, isA: 1, isB: 0, isC: 1, colour: &amp;quot;#2ecc71&amp;quot;),
    a!map(scenario: 3, isA: 1, isB: 1, isC: 0, colour: &amp;quot;#2980b9&amp;quot;)
  },
  local!selectedData:null,
  local!convertedData: a!refreshVariable(
    value: if(
      isnull(local!selectedData),
      null,
      if(
      index(local!selectedData,&amp;quot;isA&amp;quot;,null)=false(),  
      a!update(local!selectedData,{&amp;quot;isA&amp;quot;,&amp;quot;isB&amp;quot;,&amp;quot;isC&amp;quot;},{&amp;quot;Yes&amp;quot;,&amp;quot;N/A&amp;quot;,&amp;quot;N/A&amp;quot;}),
      if(
        index(local!selectedData,&amp;quot;isB&amp;quot;,null)=true(),
        a!update(local!selectedData,{&amp;quot;isA&amp;quot;,&amp;quot;isB&amp;quot;,&amp;quot;isC&amp;quot;},{&amp;quot;Yes&amp;quot;,&amp;quot;Yes&amp;quot;,if(index(local!selectedData,&amp;quot;isC&amp;quot;,null),&amp;quot;Yes&amp;quot;,&amp;quot;No&amp;quot;)}),
        a!update(local!selectedData,{&amp;quot;isA&amp;quot;,&amp;quot;isB&amp;quot;,&amp;quot;isC&amp;quot;},{&amp;quot;Yes&amp;quot;,&amp;quot;No&amp;quot;,&amp;quot;N/A&amp;quot;}),
      )
    )
    ),
    refreshOnReferencedVarChange: true()
  ),
  {
    a!columnsLayout(
      alignVertical: &amp;quot;MIDDLE&amp;quot;,
      columns: a!forEach(
        items: local!dataFromDb,
        expression: {
          a!columnLayout(
            contents: a!cardLayout(
              style: fv!item.colour,
              contents: a!richTextDisplayField(
                align: &amp;quot;CENTER&amp;quot;,
                value: a!richTextItem(
                  color: &amp;quot;#FFF&amp;quot;,
                 text: concat(&amp;quot;Scenario: &amp;quot;,fv!item.scenario)
                )
              ),
              link: a!dynamicLink(
                value: fv!item,
                saveInto: a!save(local!selectedData,save!value)
              )
            )
          )
        }
      )
    ),
   a!gridLayout(
     label: &amp;quot;Community Question&amp;quot;,
     headerCells: a!forEach(
       items: {&amp;quot;isA&amp;quot;,&amp;quot;isB&amp;quot;,&amp;quot;isC&amp;quot;},
       expression:  a!gridLayoutHeaderCell(
         label: fv!item,
         align: &amp;quot;CENTER&amp;quot;
       ),
     ),
     rows: a!gridRowLayout(
      contents: {
       a!textField(
         align: &amp;quot;CENTER&amp;quot;,
         readOnly: true(),
         value: index(local!convertedData,&amp;quot;isA&amp;quot;,null)
       ),
       a!textField(
         align: &amp;quot;CENTER&amp;quot;,
         readOnly: true(),
         value: index(local!convertedData,&amp;quot;isB&amp;quot;,null)
       ),
       a!textField(
         align: &amp;quot;CENTER&amp;quot;,
         readOnly: true(),
         value: index(local!convertedData,&amp;quot;isC&amp;quot;,null)
       )
       }
     )
   
    
   )
  }
  
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I hope that helps,&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Acacio B&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>