<?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>How to have gridLayoutHeaderCell in gridlayout ? How to create columns dynamically in a grid ?</title><link>https://community.appian.com/discussions/f/user-interface/21887/how-to-have-gridlayoutheadercell-in-gridlayout-how-to-create-columns-dynamically-in-a-grid</link><description>I am trying below code. Here, expression rule GPO_questionDetails returns a list for a given number. a!gridLayout( label:&amp;quot;program&amp;quot;, headerCells: { a!forEach( items: {&amp;quot;230108&amp;quot;,&amp;quot;230109&amp;quot;,&amp;quot;230110&amp;quot;}, expression:{ a!localVariables( local!list: rule!GPO_questionDetails</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: How to have gridLayoutHeaderCell in gridlayout ? How to create columns dynamically in a grid ?</title><link>https://community.appian.com/thread/85794?ContentTypeID=1</link><pubDate>Wed, 15 Sep 2021 17:24:04 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:5c1cd1d9-c2de-4f0c-9025-99defd4bd06d</guid><dc:creator>mounikam0001</dc:creator><description>&lt;p&gt;Thank you so much @&lt;span&gt;Richard Michaelis. It is serving my requirement.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to have gridLayoutHeaderCell in gridlayout ? How to create columns dynamically in a grid ?</title><link>https://community.appian.com/thread/85779?ContentTypeID=1</link><pubDate>Wed, 15 Sep 2021 14:27:30 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:39daef66-40c1-4d20-a24e-1c0283868b9b</guid><dc:creator>Richard Michaelis</dc:creator><description>&lt;p&gt;btw this solves the issue too ;)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to have gridLayoutHeaderCell in gridlayout ? How to create columns dynamically in a grid ?</title><link>https://community.appian.com/thread/85778?ContentTypeID=1</link><pubDate>Wed, 15 Sep 2021 14:24:03 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:118ee812-2839-400f-a964-fe9a686bcbf1</guid><dc:creator>Richard Michaelis</dc:creator><description>&lt;p&gt;Avoid the {} in your a!forEach expression parameter.&amp;nbsp; &amp;nbsp;you are doing a &amp;quot;a!forEach(items:{1,2,3}, expression:{...})&lt;br /&gt;just do a&amp;nbsp;&lt;span&gt;&amp;nbsp;&amp;quot;a!forEach(items:{1,2,3}, expression:...)&amp;nbsp; then it should be fine.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!gridLayout(
    label:&amp;quot;program&amp;quot;,
    headerCells: {
        a!forEach(
            items: {&amp;quot;230108&amp;quot;,&amp;quot;230109&amp;quot;,&amp;quot;230110&amp;quot;},
            expression:  a!localVariables(
                    local!list: rule!GPO_questionDetails(questionID: fv!item),
                    a!gridLayoutHeaderCell(label: local!list.label)
            )
            
        ),
        if(
            not(rule!APN_isTrue(ri!isReadOnly)),
            a!gridLayoutHeaderCell(label: &amp;quot;&amp;quot;),
            {}
        )
    }
),&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: How to have gridLayoutHeaderCell in gridlayout ? How to create columns dynamically in a grid ?</title><link>https://community.appian.com/thread/85766?ContentTypeID=1</link><pubDate>Wed, 15 Sep 2021 10:26:28 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:2a17946b-3449-4645-85ad-36ede663cf20</guid><dc:creator>Selvakumar Kumarasamy</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Using a flatten() function will help you in this case:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt; headerCells: {
      a!flatten(
        a!forEach(
          items: { &amp;quot;230108&amp;quot;, &amp;quot;230109&amp;quot;, &amp;quot;230110&amp;quot; },
          expression: {
            a!localVariables(
              local!list: fv!item,
              a!gridLayoutHeaderCell(label: local!list)
            )
          }
        )
      )
    }&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>