<?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>Regarding grid</title><link>https://community.appian.com/discussions/f/data/21898/regarding-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: Regarding grid</title><link>https://community.appian.com/thread/85811?ContentTypeID=1</link><pubDate>Thu, 16 Sep 2021 13:16:33 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:5752c85a-5865-4f0b-9145-3f353f449ad6</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;The example here uses a locally declared variable to simulate your data structure, it doesn&amp;#39;t end up mattering very much whether your actual source for the data is an expression rule (that&amp;#39;s perfectly fine).&amp;nbsp; The point is the operations in the value parameters of each a!gridColumn().&amp;nbsp; Though i&amp;#39;m not sure the above example actually satisfies the conditions you laid out in the original post so...&lt;/p&gt;
&lt;p&gt;The easiest thing to use in this case is probably a good old-fashioned &amp;quot;Nested If&amp;quot; for the values of the isB and isC columns (even though I usually try to avoid those in most other circumstances).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Borrowing Nitesh&amp;#39;s original code, here&amp;#39;s my suggested version:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="java"&gt;a!localVariables(
  local!data: {
    a!map(isA: 0, isB: 0, isC: 1),
    a!map(isA: 0, isB: 0, isC: 1),
    a!map(isA: 0, isB: null, isC: 1),
    a!map(isA: 1, isB: null, isC: null),
    a!map(isA: 1, isB: 1, isC: 1)
  },
  
  {
    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;isA&amp;quot;,
          value: if(fv!row.isA, &amp;quot;Yes&amp;quot;, &amp;quot;No&amp;quot;)
        ),
        a!gridColumn(
          label: &amp;quot;isB&amp;quot;,
          value: if(fv!row.isA, if(fv!row.isB, &amp;quot;Yes&amp;quot;, &amp;quot;No&amp;quot;), &amp;quot;N/A&amp;quot;)
        ),
        a!gridColumn(
          label: &amp;quot;isC&amp;quot;,
          value: if(fv!row.isA, if(fv!row.isB, if(fv!row.isC, &amp;quot;Yes&amp;quot;, &amp;quot;No&amp;quot;), &amp;quot;N/A&amp;quot;), &amp;quot;N/A&amp;quot;)
        )
      },
      validations: {}
    )
  }
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/16/pastedimage1631798243274v1.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Regarding grid</title><link>https://community.appian.com/thread/85807?ContentTypeID=1</link><pubDate>Thu, 16 Sep 2021 09:10:40 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7fb17d25-e096-417e-a138-1bcc7529fe91</guid><dc:creator>saurabh sharma</dc:creator><description>&lt;p&gt;But here in&amp;nbsp; local!data variable&amp;nbsp; i am using to Expression rule to get all data. So is I have to takes another variable then i can use that in the grid . Is it Possible&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Regarding grid</title><link>https://community.appian.com/thread/85806?ContentTypeID=1</link><pubDate>Thu, 16 Sep 2021 08:09:57 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:8212e36d-6ebf-4f1c-87d8-53d7615f02ae</guid><dc:creator>nitesht9652</dc:creator><description>&lt;p&gt;Hi Saurabh,&lt;/p&gt;
&lt;p&gt;Hope below code snippet would help you..&lt;/p&gt;
&lt;p&gt;a!localVariables(&lt;br /&gt; local!data: {&lt;br /&gt; a!map(isA: 0, isB: 0, isC: 1),&lt;br /&gt; a!map(isA: 0, isB: 0, isC: 1),&lt;br /&gt; a!map(isA: 0, isB: null, isC: 1),&lt;br /&gt; a!map(isA: 1, isB: null, isC: null)&lt;br /&gt; },&lt;br /&gt; {&lt;br /&gt; a!gridField(&lt;br /&gt; label: &amp;quot;Read-only Grid&amp;quot;,&lt;br /&gt; labelPosition: &amp;quot;ABOVE&amp;quot;,&lt;br /&gt; data: local!data,&lt;br /&gt; columns: {&lt;br /&gt; a!gridColumn(&lt;br /&gt; label: &amp;quot;isA&amp;quot;,&lt;br /&gt; value: fn!displayvalue(fv!row.isA, { 0, 1 }, { &amp;quot;No&amp;quot;, &amp;quot;Yes&amp;quot; }, &amp;quot;N/A&amp;quot;)&lt;br /&gt; ),&lt;br /&gt; a!gridColumn(&lt;br /&gt; label: &amp;quot;isB&amp;quot;,&lt;br /&gt; value: fn!displayvalue(fv!row.isB, { 0, 1 }, { &amp;quot;No&amp;quot;, &amp;quot;Yes&amp;quot; }, &amp;quot;N/A&amp;quot;)&lt;br /&gt; ),&lt;br /&gt; a!gridColumn(&lt;br /&gt; label: &amp;quot;isC&amp;quot;,&lt;br /&gt; value: fn!displayvalue(fv!row.isC, { 0, 1 }, { &amp;quot;No&amp;quot;, &amp;quot;Yes&amp;quot; }, &amp;quot;N/A&amp;quot;)&lt;br /&gt; )&lt;br /&gt; },&lt;br /&gt; validations: {}&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: Regarding grid</title><link>https://community.appian.com/thread/85802?ContentTypeID=1</link><pubDate>Thu, 16 Sep 2021 04:28:29 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:de1b5033-24e1-469d-8eae-127055e8a304</guid><dc:creator>Malathi</dc:creator><description>&lt;div class="gmail_default"&gt;Hi,&lt;/div&gt;
&lt;div class="gmail_default"&gt;&lt;/div&gt;
&lt;div class="gmail_default"&gt;On a quick look, assuming that you need to replace the value from 0,1 to No and Yes based on those three parameters. This case you can play with foreach and display value functions.&lt;/div&gt;
&lt;div class="gmail_default"&gt;&lt;/div&gt;
&lt;div class="gmail_default" style="text-align:justify;"&gt;&lt;pre class="ui-code" data-mode="text"&gt;if(all(fn!isnull,{ri!isA,ri!isB,ri!isC}),{&amp;quot;NA&amp;quot;,&amp;quot;NA&amp;quot;,&amp;quot;NA&amp;quot;},
a!forEach(
items:{ri!isA,ri!isB,ri!isC},
expression: fn!displayvalue(fv!item,{0,1},{&amp;quot;No&amp;quot;,&amp;quot;Yes&amp;quot;},&amp;quot;NA&amp;quot;)
)
)&lt;/pre&gt;&lt;/div&gt;
&lt;div class="gmail_default"&gt;&lt;/div&gt;
&lt;div class="gmail_default"&gt;If you are looking for a very specific condition as mentioned then go for decision object&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>