<?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>Validation Rule Issue</title><link>https://community.appian.com/discussions/f/user-interface/12873/validation-rule-issue</link><description>Hi, 
 I need to apply one validation rule in inline editable grid with respective to each column. Like if we enter any value in first column than it should not be available in that particular column. This rule i am applying in with -&amp;gt;a!gridRowLayout </description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Validation Rule Issue</title><link>https://community.appian.com/thread/57789?ContentTypeID=1</link><pubDate>Wed, 11 Jul 2018 01:32:43 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:6b19e446-63e3-456d-b398-35a756fd5961</guid><dc:creator>sauravk</dc:creator><description>Thanks Alok for your inputs.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Validation Rule Issue</title><link>https://community.appian.com/thread/57788?ContentTypeID=1</link><pubDate>Wed, 11 Jul 2018 01:31:42 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:4696c8ed-204c-4fcc-9477-f68c2cc66df1</guid><dc:creator>sauravk</dc:creator><description>Thanks a lot both solution worked.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Validation Rule Issue</title><link>https://community.appian.com/thread/57784?ContentTypeID=1</link><pubDate>Tue, 10 Jul 2018 22:20:06 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:0da461cd-b109-4e7f-8364-ccba244c562e</guid><dc:creator>aloks0189</dc:creator><description>May I know, are there any particular reason behind opting for applyComponents() instead forEach() because even now Appian also recommends usage of forEach wherever applicable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Is it possible for you to attach your complete code by replacing queryentity data with local!data of type dictionary (static data). It will be easy to debug and resolve this issue.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Validation Rule Issue</title><link>https://community.appian.com/thread/57763?ContentTypeID=1</link><pubDate>Tue, 10 Jul 2018 09:34:34 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:4ff47858-faa4-451f-8f44-0fc609d69527</guid><dc:creator>dipaki</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;a href="/members/sauravk"&gt;sauravk&lt;/a&gt;&amp;nbsp;,&lt;br /&gt; &lt;br /&gt; Try using any of the following,&lt;br /&gt; 1) if(&lt;br /&gt; length(&lt;br /&gt; wherecontains(ri!testData[ri!index].nameCell,ri!testData.nameCell)&lt;br /&gt; )&amp;gt;1,&lt;br /&gt; &amp;quot;Duplicate&amp;quot;,null),&lt;br /&gt; &lt;br /&gt; 2) if(&lt;br /&gt; contains(&lt;br /&gt; remove(ri!testData.nameCell, fv!index), &lt;br /&gt; ri!testData[fv!index].nameCell),&lt;br /&gt; &amp;quot;Duplicate&amp;quot;,{})&lt;br /&gt; &lt;br /&gt; If any of the above worked for you, then its not hard to understand why you were getting errors on all cells in that column.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Validation Rule Issue</title><link>https://community.appian.com/thread/57756?ContentTypeID=1</link><pubDate>Tue, 10 Jul 2018 08:53:30 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:d7cb6a68-f9e8-4384-aeec-b23106b053b6</guid><dc:creator>sauravk</dc:creator><description>1. Are you trying to execute this expression under forEach loop where each iteration calls gridRowLayout and this contains the textField which uses this expression for validation? - No i am using  a!applyComponents()&lt;br /&gt;
&lt;br /&gt;
If so, then may I know why ri!index  why not fv!index?&lt;br /&gt;
&lt;br /&gt;
2. Why wherecontains() because this returns array of indices, I believe you want to go for contains() where if array contains the given value then return &amp;quot;Duplicate&amp;quot; else {} - Still same issue coming after using this also&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Validation Rule Issue</title><link>https://community.appian.com/thread/57755?ContentTypeID=1</link><pubDate>Tue, 10 Jul 2018 08:45:44 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:95d8d850-88fb-48e1-a56c-3610a924b4dd</guid><dc:creator>aloks0189</dc:creator><description>&lt;p&gt;Hi &lt;a href="/members/sauravk"&gt;sauravk&lt;/a&gt; &amp;nbsp;one quick question here:&lt;/p&gt;
&lt;p&gt;1. Are you trying to execute this expression under forEach loop where each iteration calls gridRowLayout and this contains the textField which uses this expression for validation?&lt;/p&gt;
&lt;p&gt;If so, then may I know why ri!index &amp;nbsp;why not fv!index?&lt;/p&gt;
&lt;p&gt;2. Why wherecontains() because this returns array of indices, I believe you want to go for contains() where if array contains the given value then return &amp;quot;Duplicate&amp;quot; else &amp;#123;&amp;#125;&lt;/p&gt;
&lt;p&gt;E.g. &lt;/p&gt;
&lt;p&gt;if(contains(ri!testData.nameCell,ri!testData[fv!index].nameCell),&amp;quot;Duplicate&amp;quot;,&amp;#123;&amp;#125;)&lt;/p&gt;
&lt;p&gt;Also don&amp;#39;t forget to have a null check or the type conversion otherwise when any one of the variable is null, you can expect an error saying: cannot compare null with Text&lt;/p&gt;
&lt;p&gt;Hope this helps.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>