<?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>On selection of one row disable the other rows in grid based on the status</title><link>https://community.appian.com/discussions/f/new-to-appian/30788/on-selection-of-one-row-disable-the-other-rows-in-grid-based-on-the-status</link><description>Hello Everyone, 
 I am working on a!gridField and need to select the rows which are of same status and other rows should be disabled(Non selectable). 
 For Example : If I select any row with status :&amp;quot;Inprogress&amp;quot; then only inprogress rows should be selectable</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: On selection of one row disable the other rows in grid based on the status</title><link>https://community.appian.com/thread/122730?ContentTypeID=1</link><pubDate>Tue, 05 Dec 2023 06:12:45 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:21943351-07ad-494d-bf9d-d7d21a01dcff</guid><dc:creator>hemap0003</dc:creator><description>&lt;p&gt;&amp;nbsp;&lt;a href="/members/deepakr0003"&gt;deepakrana7&lt;/a&gt;&amp;nbsp;Thanks for your time &amp;amp; response Deepak but I need to verify for group statuses instead of each status.&lt;br /&gt;{Draft,Draft Rework,Draft Approved} into one group and if I select any the rows with these status should be able to select where the other group status : {Metadata Review,Metadata Rework,Complete,Cancelled} should be disbaled.&lt;br /&gt;&lt;br /&gt;I have tried by passing the values into seperate expression rule which contains foreach function but this throwing an error stating refresh variable required.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong class="StrongText---richtext_strong StrongText---inMessageLayout StrongText---error"&gt;Could not display interface. Please check definition and inputs.&lt;/strong&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;Interface Definition: Expression evaluation error at function a!gridField [line 341]: Expression evaluation error at function a!forEach [line 402]: The load() function cannot be used within rules called by looping functions other than a!forEach(). Pass the necessary variables via rule inputs or use a!forEach().&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: On selection of one row disable the other rows in grid based on the status</title><link>https://community.appian.com/thread/122729?ContentTypeID=1</link><pubDate>Tue, 05 Dec 2023 06:08:48 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:b266a47a-fc93-4923-9a91-6a53f892bffa</guid><dc:creator>hemap0003</dc:creator><description>&lt;p&gt;&amp;nbsp;This worked excellant.Thanks Stefan but now the requirement changed as if user select &amp;quot;Draft&amp;quot; or&amp;nbsp; &amp;quot;Draft Review&amp;quot; then the rows with these status can be enabled and other status(Complete &amp;amp; Cancelled) should be disabled or vice versa.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: On selection of one row disable the other rows in grid based on the status</title><link>https://community.appian.com/thread/122650?ContentTypeID=1</link><pubDate>Mon, 04 Dec 2023 08:09:26 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7790ce52-9079-4643-ba77-d1ed4119565b</guid><dc:creator>deepakrana7</dc:creator><description>&lt;p&gt;Hey &lt;a href="/members/hemap0003"&gt;hemap0003&lt;/a&gt;&amp;nbsp;, as Stefan suggested since it is a list you can use contains or index the first selected row.&lt;br /&gt;&lt;br /&gt;Try this.&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!selectedRows,
  local!workflowStatus: {
    { workflowStatus: &amp;quot;Draft&amp;quot; },
    { workflowStatus: &amp;quot;Draft&amp;quot; },
    { workflowStatus: &amp;quot;Completed&amp;quot; },
    { workflowStatus: &amp;quot;Completed&amp;quot; },
    { workflowStatus: &amp;quot;Completed&amp;quot; },
    { workflowStatus: &amp;quot;Review&amp;quot; },
    { workflowStatus: &amp;quot;Review&amp;quot; },
    { workflowStatus: &amp;quot;Review&amp;quot; }
  },
  {
    a!gridField(
      selectable: true,
      data: local!workflowStatus,
      selectionValue: local!selectedRows,
      selectionSaveInto: {
        local!selectedRows,
        /* if the user clicked on all select checkbox, we can&amp;#39;t hide this but you can add custom checkbox field in place of grid field checkbox if it is somewhat not performant */
        a!save(
          local!selectedRows,
          a!forEach(
            items: local!selectedRows,
            expression: if(
              a!isNullOrEmpty(local!selectedRows),
              {},
              if(
                index(
                  index(
                    index(
                      local!workflowStatus,
                      local!selectedRows,
                      {}
                    ),
                    &amp;quot;workflowStatus&amp;quot;,
                    {}
                  ),
                  1,
                  {}
                ) &amp;lt;&amp;gt; index(
                  index(local!workflowStatus, fv!item, {}),
                  &amp;quot;workflowStatus&amp;quot;,
                  {}
                ),
                {},
                fv!item
              )
            )
          )
        )
      },
      disableRowSelectionWhen: if(
        a!isNullOrEmpty(local!selectedRows),
        {},
        index(
          index(
            index(
              local!workflowStatus,
              local!selectedRows,
              {}
            ),
            &amp;quot;workflowStatus&amp;quot;,
            {}
          ),
          1,
          {}
        ) &amp;lt;&amp;gt; index(fv!row, &amp;quot;workflowStatus&amp;quot;, {})
      ),
      columns: {
        a!gridColumn(
          label: &amp;quot;Status&amp;quot;,
          value: fv!row.workflowStatus
        )
      }
    )
  }
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: On selection of one row disable the other rows in grid based on the status</title><link>https://community.appian.com/thread/122648?ContentTypeID=1</link><pubDate>Mon, 04 Dec 2023 07:54:02 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:5549ec5d-d3bd-4de6-b75b-484a0b244a5d</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;The compare operator does not make much sense. Comparing a list to a single value returns a list of true/false values which you then feed into that parameter.&lt;/p&gt;
&lt;p&gt;I understand your explanation a bit different. As soon as a single row is selected, only rows with the same status should stay selectable. If this is the case, I think working code might look like this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;contains(index(local!selectedRows, &amp;quot;workflowStatus&amp;quot;, {}), index(fv!row, &amp;quot;workflowStatus&amp;quot;, {}))&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: On selection of one row disable the other rows in grid based on the status</title><link>https://community.appian.com/thread/122640?ContentTypeID=1</link><pubDate>Mon, 04 Dec 2023 04:28:32 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:6d3b5fbd-39ed-4e49-8551-665f3fcf1179</guid><dc:creator>hemap0003</dc:creator><description>&lt;p&gt;I have tried on this parameter but could not able achieve could you please help me with sample code&lt;/p&gt;
&lt;p&gt;The way I have tried :&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="xml"&gt;disableRowSelectionWhen : if(
            a!isNullOrEmpty(local!selected),
            {},
            index(local!selectedRows, &amp;quot;workflowStatus&amp;quot;, {}) &amp;lt;&amp;gt; index(fv!row, &amp;quot;workflowStatus&amp;quot;, {})
          )&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;For suppose I have 7 rows with 2 drafts status &amp;amp; 3 completed status,2 Review status.Now if I select one draft status remaining 5 of other status getting disabled and after I select the 2 draft status row then the entire grid rows were getting disabled with two draft status selected.Is there any way to stop after selecting all the available draft status rows.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="/resized-image/__size/640x480/__key/communityserver-discussions-components-files/62/pastedimage1701666707454v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: On selection of one row disable the other rows in grid based on the status</title><link>https://community.appian.com/thread/122556?ContentTypeID=1</link><pubDate>Fri, 01 Dec 2023 10:01:14 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:d7d4f88f-6710-45df-a011-f0ecb5f2d5af</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;Have a look at the parameter &amp;quot;disableRowSelectionWhen&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://docs.appian.com/suite/help/23.4/Paging_Grid_Component.html#parameters"&gt;docs.appian.com/.../Paging_Grid_Component.html&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>