<?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>Dynamic grid .</title><link>https://community.appian.com/discussions/f/user-interface/17736/dynamic-grid</link><description>Hi , 
 
 I have a requirement in which the user enters any numerical value , lets say 2 , so a grid should be created with two rows. Likewise, he can enter n values , so n rows should be created . The entries filled into these rows(grid) are to be saved</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Dynamic grid .</title><link>https://community.appian.com/thread/69912?ContentTypeID=1</link><pubDate>Mon, 14 Oct 2019 10:26:01 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:a1fd318c-be67-4368-ba88-e4e03dfbd44e</guid><dc:creator>ST07</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: Dynamic grid .</title><link>https://community.appian.com/thread/69872?ContentTypeID=1</link><pubDate>Thu, 10 Oct 2019 19:09:54 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:3398c478-c65e-4faf-9904-0f2b142ca772</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;On Line 41: please try replacing &amp;quot;&lt;strong&gt;items: ri!rows&lt;/strong&gt;&amp;quot;, with &amp;quot;&lt;strong&gt;items: enumerate(ri!rows)&lt;/strong&gt;&amp;quot;&lt;/p&gt;
&lt;p&gt;The way it&amp;#39;s written currently, you will only ever create one row in your rule input CDT, instead of initializing an array based on the number entered.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Dynamic grid .</title><link>https://community.appian.com/thread/69847?ContentTypeID=1</link><pubDate>Thu, 10 Oct 2019 08:44:17 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:5a1076e1-6b4d-415c-836c-60c670d1ce54</guid><dc:creator>ST07</dc:creator><description>&lt;p&gt;krishna , grid stil isn&amp;#39;t coming. Can you please guide me ?&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Here I am&amp;nbsp; saving grid values into policy master table .policdetails and rows are ri. policydetails Ri is of type policy master table (array type),&lt;/p&gt;
&lt;p&gt;grid data should be saved into policy master table aftr submit. please let me know .&amp;nbsp;&amp;nbsp;&lt;pre class="ui-code" data-mode="text"&gt;load(
  local!rowsCount,
  local!items: {},
  local!caseDetails: if(
    isnull(
      ri!caseId
    ),
    {},
    rule!APAC_getCaseDetailsFromCaseID(
      caseId: ri!caseId
    ).data
  ),
  {
    rule!APAC_caseDetailsSectionUI(
      caseDetails: local!caseDetails
    ),
    a!sectionLayout(
      contents: {
        a!columnsLayout(
          columns: {
            a!columnLayout(
              contents: {
                a!integerField(
                  label: &amp;quot;Enter Number of Policies &amp;quot; ,
                  value: local!rowsCount,
                  saveInto: {
                    local!rowsCount,
                    a!save(
                      ri!rows,
                      local!rowsCount
                    ),
                    a!save(
                      ri!policyDetails,
                      cast(
                        typeof(
                          {
                            &amp;#39;type!{urn:aig:types:collections:APAC}CLN_SGP_POLICY_MASTER&amp;#39;()
                          }
                        ),
                        a!forEach(
                          items: ri!rows,
                          expression: {
                            &amp;#39;type!{urn:aig:types:collections:APAC}CLN_SGP_POLICY_MASTER&amp;#39;(
                              policy_number: null,
                              insured_name: null,
                              producer_code: null,
                              commission_amt: null,
                              
                            )
                          }
                        )
                      )
                    ),
                    a!save(
                      local!items,
                      if(
                        isnull(
                          local!rowsCount
                        ),
                        {},
                        a!forEach(
                          items: repeat(
                            local!rowsCount,
                            1
                          ),
                          expression: {
                            policy_number: &amp;quot;&amp;quot;,
                            insured_name: &amp;quot;&amp;quot;,
                            producer_code:&amp;quot;&amp;quot;,
                            commission_amt:&amp;quot;&amp;quot;,
                          }
                        )
                      )
                    )
                  }
                )
              }
            ),
            a!columnLayout(
              contents: {}
            )
          }
        ),
        a!gridLayout(
          label: &amp;quot;Dynamic Grid&amp;quot;,
          headerCells: {
            a!gridLayoutHeaderCell(
              label: &amp;quot;Policy Number&amp;quot;
            ),
            a!gridLayoutHeaderCell(
              label: &amp;quot;Insured Name&amp;quot;
            ),
            a!gridLayoutHeaderCell(
              label: &amp;quot;Producer Code &amp;quot;
            ),
            a!gridLayoutHeaderCell(
              label: &amp;quot;Amount to Refund&amp;quot;
            )
          },
          rows: {
            a!forEach(
              items: ri!policyDetails,
              expression: a!gridRowLayout(
                contents: {
                  a!textField(
                    value: ri!policyDetails[fv!index].policy_number,
                    saveInto: ri!policyDetails[fv!index].policy_number
                  ),
                  a!textField(
                    value: ri!policyDetails[fv!index].insured_name,
                    saveInto: ri!policyDetails[fv!index].insured_name
                  ),
                  a!textField(
                    value: ri!policyDetails[fv!index].producer_code,
                    saveInto: ri!policyDetails[fv!index].producer_code
                  ),
                  a!textField(
                    value: ri!policyDetails[fv!index].commission_amt,
                    saveInto: ri!policyDetails[fv!index].commission_amt
                  )
                }
              )
            )
          },
          showWhen: if(
            isnull(
              local!rowsCount
            ),
            false(),
            true()
          ),
          rowHeader: 1
        )
      }
    ),
    a!buttonArrayLayout(
      buttons: {
        a!buttonWidget(
          label: &amp;quot;Submit&amp;quot;,
          style: &amp;quot;PRIMARY&amp;quot;,
          value: cons!APAC_TEXT_ACTIONS[1],
          submit: true(),
          saveInto: ri!buttonAction,
          confirmMessage: &amp;quot;Are you sure you want to submit?&amp;quot;,
          
        )
      },
      align: &amp;quot;END&amp;quot;
    )
  }
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Dynamic grid .</title><link>https://community.appian.com/thread/69837?ContentTypeID=1</link><pubDate>Wed, 09 Oct 2019 15:18:53 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:b20665d1-595f-4809-9a70-545cce83e264</guid><dc:creator>Krishna Chaitanya Mallavarapu</dc:creator><description>&lt;p&gt;check with this code&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;load(
  local!rowsCount,
  local!items: {},
  local!caseDetails: if(
    isnull(
      ri!caseId
    ),
    {},
    rule!APAC_getCaseDetailsFromCaseID(
      caseId: ri!caseId
    ).data
  ),
  {
    rule!APAC_caseDetailsSectionUI(
      caseDetails: local!caseDetails
    ),
    a!sectionLayout(
      contents: {
        a!columnsLayout(
          columns: {
            a!columnLayout(
              contents: {
                a!integerField(
                  label: &amp;quot;Enter No Of Rows&amp;quot;,
                  value: local!rowsCount,
                  saveInto: {
                    local!rowsCount,
                    a!save(
                      local!items,
                      if(
                        isnull(
                          local!rowsCount
                        ),
                        {},
                        a!forEach(
                          items: repeat(
                            local!rowsCount,
                            1
                          ),
                          expression: {
                            firstName: &amp;quot;&amp;quot;,
                            lastName: &amp;quot;&amp;quot;
                          }
                        )
                      )
                    )
                  }
                )
              }
            ),
            a!columnLayout(
              contents: {}
            )
          }
        ),
        a!gridLayout(
          label: &amp;quot;Dynamic Grid&amp;quot;,
          headerCells: {
            a!gridLayoutHeaderCell(
              label: &amp;quot;First Name&amp;quot;
            ),
            a!gridLayoutHeaderCell(
              label: &amp;quot;Last Name&amp;quot;
            ),
            
          },
          rows: {
            a!forEach(
              items: local!items,
              expression: a!gridRowLayout(
                contents: {
                  a!textField(
                    value: local!items[fv!index].firstName,
                    saveInto: local!items[fv!index].firstName
                  ),
                  a!textField(
                    value: local!items[fv!index].lastName,
                    saveInto: local!items[fv!index].lastName
                  )
                }
              )
            )
          },
          rowHeader: 1,
          showWhen: if(
            isnull(
              local!rowsCount
            ),
            false(),
            true()
          )
        )
      }
    )
  }
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Dynamic grid .</title><link>https://community.appian.com/thread/69836?ContentTypeID=1</link><pubDate>Wed, 09 Oct 2019 14:58:40 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7440c7de-1387-499b-935d-4f7016795876</guid><dc:creator>ST07</dc:creator><description>&lt;p&gt;&lt;strong&gt;Interface Definition: Expression evaluation error :&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;hi , I am getting the above error while using this code , i have added one rule and an interface , this grid section should come below that case details section interface , is there anything that i am doing wrong ?&lt;pre class="ui-code" data-mode="text"&gt;load(
  local!rowsCount,
  local!items,
  local!caseDetails: if(
    isnull(
      ri!caseId
    ),
    {},
    rule!APAC_getCaseDetailsFromCaseID(
      caseId: ri!caseId
    ).data
  ),
  {
    rule!APAC_caseDetailsSectionUI(
      caseDetails: local!caseDetails
    ),
    local!rowsCount,
    local!items: {},
    a!sectionLayout(
      contents: {
        a!columnsLayout(
          columns: {
            a!columnLayout(
              contents: {
                a!integerField(
                  label: &amp;quot;Enter No Of Rows&amp;quot;,
                  value: local!rowsCount,
                  saveInto: {
                    local!rowsCount,
                    a!save(
                      local!items,
                      if(
                        isnull(
                          local!rowsCount
                        ),
                        {},
                        a!forEach(
                          items: repeat(
                            local!rowsCount,
                            1
                          ),
                          expression: {
                            firstName: &amp;quot;&amp;quot;,
                            lastName: &amp;quot;&amp;quot;
                          }
                        )
                      )
                    )
                  }
                )
              }
            ),
            a!columnLayout(
              contents: {}
            )
          }
        ),
        a!gridLayout(
          label: &amp;quot;Dynamic Grid&amp;quot;,
          headerCells: {
            a!gridLayoutHeaderCell(
              label: &amp;quot;First Name&amp;quot;
            ),
            a!gridLayoutHeaderCell(
              label: &amp;quot;Last Name&amp;quot;
            ),
            
          },
          rows: {
            a!forEach(
              items: local!items,
              expression: a!gridRowLayout(
                contents: {
                  a!textField(
                    value: local!items[fv!index].firstName,
                    saveInto: local!items[fv!index].firstName
                  ),
                  a!textField(
                    value: local!items[fv!index].lastName,
                    saveInto: local!items[fv!index].lastName
                  )
                }
              )
            )
          },
          rowHeader: 1,
          showWhen: if(
            isnull(
              local!rowsCount
            ),
            false(),
            true()
          )
        )
      }
    )
  }
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Dynamic grid .</title><link>https://community.appian.com/thread/69834?ContentTypeID=1</link><pubDate>Wed, 09 Oct 2019 14:40:04 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f2a114a2-09df-425c-8858-272a48fe4391</guid><dc:creator>ST07</dc:creator><description>&lt;p&gt;hey , thanks , this is exactly what i needed.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Dynamic grid .</title><link>https://community.appian.com/thread/69833?ContentTypeID=1</link><pubDate>Wed, 09 Oct 2019 14:30:16 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:77dae02b-da84-4177-bf33-1a46dbea52ed</guid><dc:creator>Krishna Chaitanya Mallavarapu</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;load(
  local!rowsCount,
  local!items: {},
  a!sectionLayout(
    contents: {
      a!columnsLayout(
        columns: {
          a!columnLayout(
            contents: {
              a!integerField(
                label: &amp;quot;Enter No Of Rows&amp;quot;,
                value: local!rowsCount,
                saveInto: {
                  local!rowsCount,
                  a!save(
                    local!items,
                    if(
                      isnull(
                        local!rowsCount
                      ),
                      {},
                      a!forEach(
                        items: repeat(
                          local!rowsCount,
                          1
                        ),
                        expression: {
                          firstName: &amp;quot;&amp;quot;,
                          lastName: &amp;quot;&amp;quot;
                        }
                      )
                    )
                  )
                }
              )
            }
          ),
          a!columnLayout(
            contents: {}
          )
        }
      ),
      a!gridLayout(
        label: &amp;quot;Dynamic Grid&amp;quot;,
        headerCells: {
          a!gridLayoutHeaderCell(
            label: &amp;quot;First Name&amp;quot;
          ),
          a!gridLayoutHeaderCell(
            label: &amp;quot;Last Name&amp;quot;
          ),
          
        },
        rows: {
          a!forEach(
            items: local!items,
            expression: a!gridRowLayout(
              contents: {
                a!textField(
                  value: local!items[fv!index].firstName,
                  saveInto: local!items[fv!index].firstName
                ),
                a!textField(
                  value: local!items[fv!index].lastName,
                  saveInto: local!items[fv!index].lastName
                )
              }
            )
          )
        },
        rowHeader: 1,
        showWhen: if(
          isnull(
            local!rowsCount
          ),
          false(),
          true()
        )
      )
    }
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Dynamic grid .</title><link>https://community.appian.com/thread/69832?ContentTypeID=1</link><pubDate>Wed, 09 Oct 2019 14:19:42 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:4f21b276-3ead-4600-ae7e-2b45a2389d30</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;If you can tell us what you&amp;#39;ve tried so far and what issues you&amp;#39;re having, that would better enable us to help you here.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>