<?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 add validation to an inline grid addRowLink?</title><link>https://community.appian.com/discussions/f/user-interface/18297/how-to-add-validation-to-an-inline-grid-addrowlink</link><description>I have an Inline Grid created, which has addRowLink, used to create a new row each time it is clicked but the scenario is that the user should not be able to click that link more than 5 times, i.e. after creating a 5th row, the link should be disabled</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: How to add validation to an inline grid addRowLink?</title><link>https://community.appian.com/thread/71976?ContentTypeID=1</link><pubDate>Mon, 10 Feb 2020 13:31:01 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7edddc9d-dabf-46c3-95fd-9352882c6a7e</guid><dc:creator>varunkumarb0001</dc:creator><description>&lt;p&gt;lol. Even I came up with the same solution. Thanks for confirming...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to add validation to an inline grid addRowLink?</title><link>https://community.appian.com/thread/71975?ContentTypeID=1</link><pubDate>Mon, 10 Feb 2020 13:25:16 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:84fafdfc-4b64-4f99-b2fe-9001f13ccd4d</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;The simplest way to do this is just remove the Add Row Link when you have reached the maximum number of grid elements.&amp;nbsp; The Add Row Link itself doesn&amp;#39;t have a validation configuration.&amp;nbsp; You could add validation on the Grid itself, but assuming you set up the Add Row link properly, there should be no way by which the validation condition could ever become true.&lt;/p&gt;
&lt;p&gt;Quick example:&lt;br /&gt;&lt;pre class="ui-code" data-mode="java"&gt;a!localVariables(
  
  local!gridContents: {
    {
      id: 1,
      name: &amp;quot;asdf&amp;quot;
    }
  },
  
  a!sectionLayout(
    label: &amp;quot;Test Grid&amp;quot;,
    contents: {
      a!gridLayout(
        headerCells: {
          a!gridLayoutHeaderCell(label: &amp;quot;Id&amp;quot;),
          a!gridLayoutHeaderCell(label: &amp;quot;Name&amp;quot;)
        },
        columnConfigs: {
          a!gridLayoutColumnConfig(width: &amp;quot;NARROW&amp;quot;)
        },
        rows: a!forEach(
          local!gridContents,
          a!gridRowLayout(
            contents: {
              a!textField(
                value: fv!item.id,
                readOnly: true()
              ),
              a!textField(
                value: fv!item.name,
                saveInto: fv!item.name
              )
            }
          )
        ),
        addRowLink: a!dynamicLink(
          label: &amp;quot;Add Row&amp;quot;,
          /* in older versions of Appian, using a showWhen here would result in an error condition, 
            so it was necessary to wrap the whole dynamicLink in an if() statement.  This seems to 
            now be fixed (as of Appian 19.4) */
          showWhen: length(local!gridContents) &amp;lt; 6,
          saveInto: {
            a!save(
              local!gridContents,
              append(local!gridContents, {id: null(), name: null()})
            )
          }
        )
      )
    }
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>