<?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>Want to disable button conditionally on addRowlink: a!dynamicLink</title><link>https://community.appian.com/discussions/f/user-interface/12095/want-to-disable-button-conditionally-on-addrowlink-a-dynamiclink</link><description>Hi All, 
 I want to disable button if data set contains one row already . I want to restrict to add more then one. If it is more than one then Add button should not allow me to add new row. 
 
 Please help me on that. 
 
 addRowlink: a!dynamicLink( label</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Want to disable button conditionally on addRowlink: a!dynamicLink</title><link>https://community.appian.com/thread/53608?ContentTypeID=1</link><pubDate>Fri, 23 Mar 2018 05:45:38 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:dffdba87-a0de-4416-892b-e98aacbdb0b6</guid><dc:creator>santoshd378</dc:creator><description>Hi sauravk,&lt;br /&gt;
&lt;br /&gt;
You can just use if condition for hiding the add row link, &lt;br /&gt;
&lt;br /&gt;
addRowLink: if(count(ri!data)&amp;gt;1,{},a!dynamicLink(...))&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Want to disable button conditionally on addRowlink: a!dynamicLink</title><link>https://community.appian.com/thread/53588?ContentTypeID=1</link><pubDate>Thu, 22 Mar 2018 15:54:11 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:46a3cf3f-41f3-4b9e-8648-22440c79f5e0</guid><dc:creator>John M</dc:creator><description>&lt;p&gt;You can&amp;#39;t show the link as disabled using addRowLink, but you could hide it if there is already an existing row in the table. You could do something like this:&lt;/p&gt;
&lt;pre&gt;&lt;span style="font-family:arial, helvetica, sans-serif;"&gt;&lt;code&gt;&lt;br /&gt;&lt;/code&gt;&lt;/span&gt;load(&lt;br /&gt;  local!rows: {},&lt;br /&gt;  a!gridLayout(&lt;br /&gt;    headerCells: {&lt;br /&gt;      a!gridLayoutHeaderCell(label: &amp;quot;label&amp;quot;),&lt;br /&gt;      a!gridLayoutHeaderCell(label: &amp;quot;&amp;quot;)&lt;br /&gt;    },&lt;br /&gt;    columnConfigs: {&lt;br /&gt;      a!gridLayoutColumnConfig(width: &amp;quot;DISTRIBUTE&amp;quot;),&lt;br /&gt;      a!gridLayoutColumnConfig(width: &amp;quot;ICON&amp;quot;)&lt;br /&gt;    },&lt;br /&gt;    rows: a!forEach(&lt;br /&gt;      local!rows,&lt;br /&gt;      a!gridRowLayout(&lt;br /&gt;        contents: {&lt;br /&gt;           a!textField(value: fv!item.label, saveInto: fv!item.label),&lt;br /&gt;           a!imageField(&lt;br /&gt;            images: a!documentImage(&lt;br /&gt;              document: a!iconIndicator(&amp;quot;REMOVE&amp;quot;),&lt;br /&gt;              link: a!dynamicLink(&lt;br /&gt;                value: fv!index,&lt;br /&gt;                saveInto: a!save(local!rows, remove(local!rows, save!value))&lt;br /&gt;              )&lt;br /&gt;            )&lt;br /&gt;          )&lt;br /&gt;        }&lt;br /&gt;      )&lt;br /&gt;    ),&lt;br /&gt;    addRowLink: if(count(local!rows) &amp;gt; 0, null,&lt;br /&gt;      a!dynamicLink(&lt;br /&gt;        label: &amp;quot;Add New Row&amp;quot;,&lt;br /&gt;        value: {label: null},&lt;br /&gt;        saveInto: a!save(local!rows, append(local!rows, save!value))&lt;br /&gt;      )&lt;br /&gt;    )&lt;br /&gt;  )&lt;br /&gt;)&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Want to disable button conditionally on addRowlink: a!dynamicLink</title><link>https://community.appian.com/thread/53569?ContentTypeID=1</link><pubDate>Thu, 22 Mar 2018 12:16:40 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:34d85c86-5b63-4137-9ddd-262544321081</guid><dc:creator>bryant.st39</dc:creator><description>&lt;p&gt;&lt;em&gt;&lt;strong&gt;addRowlink:&amp;nbsp;&lt;/strong&gt;&lt;/em&gt;if(length(&amp;#39;array&amp;#39;) &amp;gt;1, null(), a!dynamicLink(&lt;br /&gt; label: &amp;quot;Sample&amp;quot;,&lt;br /&gt; value: &amp;#39;type!{****&amp;#39;(***,***,***),&lt;br /&gt; saveInto: {a!save(***,append(***))}&lt;br /&gt; ))&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Where the &amp;#39;array&amp;#39; is the object you want to limit...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>