<?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>Trying to understand local/scoping of variables</title><link>https://community.appian.com/discussions/f/new-to-appian/28040/trying-to-understand-local-scoping-of-variables</link><description>Hi: 
 I was experimenting with the Grid example in Appian Tutorials ( https://docs.appian.com/suite/help/23.1/Grid_Tutorial.html ) and noticed that I had some rows with no firstName and LastName. So, I thought I would use &amp;quot;fv!row.firstName&amp;quot; as part of</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Trying to understand local/scoping of variables</title><link>https://community.appian.com/thread/109218?ContentTypeID=1</link><pubDate>Sat, 11 Mar 2023 20:02:10 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:49a935e4-2d6e-4a11-b6f8-8321b2dcb794</guid><dc:creator>MaNa</dc:creator><description>&lt;p&gt;Abhay:&amp;nbsp; That is what I learned from Stefan and you.&amp;nbsp; I am used to using {} to segment code from C/C++ - Appian seems to have interpretations based on {} - didn&amp;#39;t realize { indicated start of expression.&amp;nbsp; Live and Learn.&lt;/p&gt;
&lt;p&gt;I am going to post another problem - for nested forEach() - where not sure why the local variables are not working.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trying to understand local/scoping of variables</title><link>https://community.appian.com/thread/109217?ContentTypeID=1</link><pubDate>Sat, 11 Mar 2023 19:58:43 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:173a0237-266d-49b8-843c-15b847a99242</guid><dc:creator>MaNa</dc:creator><description>&lt;p&gt;Mike,&lt;/p&gt;
&lt;p&gt;That sounds like an approach I should investigate - will do soon.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trying to understand local/scoping of variables</title><link>https://community.appian.com/thread/109197?ContentTypeID=1</link><pubDate>Fri, 10 Mar 2023 20:38:54 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:04ed4315-723c-41de-9482-4542b16d8ace</guid><dc:creator>Abhay Dalsaniya</dc:creator><description>[quote userid="82813" url="~/discussions/f/new-to-appian/28040/trying-to-understand-local-scoping-of-variables/109158#109158"]As for the syntax in image&amp;nbsp;2, isn&amp;#39;t the a!localVariable() on line 1, similar to the example in your response?[/quote]
&lt;p&gt;No it is not. The {} start the&amp;nbsp;expression part and you cannot define local variable in the expression part directly the way you did it. To do that you need to have another nested localvariable() function, as I mentioned in my previous response. Hope this helps!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trying to understand local/scoping of variables</title><link>https://community.appian.com/thread/109191?ContentTypeID=1</link><pubDate>Fri, 10 Mar 2023 19:45:08 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f3aa4a54-9900-4722-ac2f-c2bf986d012f</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;Yes, if the requirement is that your form should show GPA and that the only rows which appear are those where it&amp;#39;s non-blank, then the key is to filter your data in advance of feeding it into your grid.&lt;/p&gt;
&lt;p&gt;If you&amp;#39;re querying the data from the DB, then you would simply provide a query filter and filter out rows where that value is not populated.&lt;/p&gt;
&lt;p&gt;If, on the other hand, you are passing the whole data set (with a mixture of rows) like as a process PV array, then you could instead create an on-form temp variable consisting only of the rows you&amp;#39;d like to display.&amp;nbsp; Something along the lines of, &lt;em&gt;&lt;strong&gt;local!myTemp&lt;/strong&gt;&lt;strong&gt;Array: a!forEach(ri!myWholeArray, if(a!isNullOrEmpty(fv!item.GPA), {}, fv!item)&lt;/strong&gt;&lt;/em&gt; within your local variables declaration.&amp;nbsp; Then you&amp;#39;d simply pass that local variable into the &lt;em&gt;data&lt;/em&gt; parameter of your grid, and you&amp;#39;d be displaying only the rows which have a value populated here.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trying to understand local/scoping of variables</title><link>https://community.appian.com/thread/109190?ContentTypeID=1</link><pubDate>Fri, 10 Mar 2023 19:44:50 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:12438519-3b66-4d2d-8765-4c9a04f2c615</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;I support you idea of fetching only the required data instead of fetching all, wasting memory and trying to hide some of the data in the UI.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trying to understand local/scoping of variables</title><link>https://community.appian.com/thread/109189?ContentTypeID=1</link><pubDate>Fri, 10 Mar 2023 19:40:09 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:91c18da3-5667-426a-992a-0058bbc0f517</guid><dc:creator>MaNa</dc:creator><description>&lt;p&gt;Mike,&lt;/p&gt;
&lt;p&gt;The use case is when multiple faculty members submit grades for a student and GPAs are calculated after all faculty members submit their grades. &amp;nbsp;Until all grades are submitted, the GPA column is null. &amp;nbsp;So, I didn&amp;#39;t want the interface displaying any rows where GPA column is null.&lt;/p&gt;
&lt;p&gt;Guess&amp;nbsp;the right approach would be to filter the data (pass only rows where the GPA column is not NULL) but I was experimenting to explore&amp;nbsp;if there was a way to provide users with an option to either view or not view a row based on a column value (e.g., show only students/GPAs that qualify for Deans&amp;#39; List).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trying to understand local/scoping of variables</title><link>https://community.appian.com/thread/109182?ContentTypeID=1</link><pubDate>Fri, 10 Mar 2023 19:13:31 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:576c932c-5f04-4cab-b56b-eb2900ee56ff</guid><dc:creator>Mike Schmitt</dc:creator><description>[quote userid="82813" url="~/discussions/f/new-to-appian/28040/trying-to-understand-local-scoping-of-variables/109176#109176"]that would allow me to hide an entire row if one or more columns have is empty/null[/quote]
&lt;p&gt;You might want to think a bit more about this.&amp;nbsp; Why would you want to hide a &lt;em&gt;row&lt;/em&gt; when a &lt;em&gt;column&lt;/em&gt; has an entirely empty/null value?&amp;nbsp; What would this even look like / accomplish?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trying to understand local/scoping of variables</title><link>https://community.appian.com/thread/109176?ContentTypeID=1</link><pubDate>Fri, 10 Mar 2023 15:56:49 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:b8a5a8fd-bf3f-4ecf-a9e7-eb5b172c5104</guid><dc:creator>MaNa</dc:creator><description>&lt;p&gt;I guess what I am looking for is something similar to &amp;#39;&lt;span&gt;disableRowSelectionWhen&amp;#39; that would allow me to hide an entire row if one or more columns have is empty/null.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trying to understand local/scoping of variables</title><link>https://community.appian.com/thread/109173?ContentTypeID=1</link><pubDate>Fri, 10 Mar 2023 13:44:49 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:e10a5efc-cadd-4a99-9b77-81e5988ed92f</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;So, facts first. As per the documentation fv!row can ONLY be used when assigning to the value parameter.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://docs.appian.com/suite/help/23.1/Grid_Column_Component.html#parameters"&gt;https://docs.appian.com/suite/help/23.1/Grid_Column_Component.html#parameters&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Now, about the why. It just does not make sense in any other parameter as the gridColumn component defines the logic for the whole column.&lt;/p&gt;
&lt;p&gt;If you want to show/hide a component in an individual cell, just add a richttextdisplayfield and make it show data according to your logic.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trying to understand local/scoping of variables</title><link>https://community.appian.com/thread/109172?ContentTypeID=1</link><pubDate>Fri, 10 Mar 2023 12:58:32 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:cb7eed51-16b5-42f4-8019-af67cb7e790b</guid><dc:creator>MaNa</dc:creator><description>&lt;p&gt;Stefan,&lt;/p&gt;
&lt;p&gt;I can accept that Appian treats the curly-braces as the start of an expression. &amp;nbsp;Back to my original issue, which is why is using&amp;nbsp;&amp;quot;fv!row&amp;quot; (image below) causing a scoping variable issue. &amp;nbsp;Isn&amp;#39;t fv!row part of the gridField function that should be available at line:56? &amp;nbsp;It is available at line 55. &amp;nbsp;If passing it to the isNotNullorEmpty function is the issue, how do I access the value of fv!row&amp;nbsp;in a function/expression for something like let&amp;#39;s say to determine if the row is an odd or even row?&lt;/p&gt;
&lt;p&gt;Thanks for your help.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image/__size/640x480/__key/communityserver-discussions-components-files/62/pastedimage1678452897566v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trying to understand local/scoping of variables</title><link>https://community.appian.com/thread/109164?ContentTypeID=1</link><pubDate>Fri, 10 Mar 2023 07:09:07 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:11713b66-9271-4b40-9b19-bfd9981cd2dd</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;It is not the same. Because of the added curly brackets that local variable is never declared as Appian evaluates this as the expression part of a!localVariables.&lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/62/pastedimage1678432120450v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trying to understand local/scoping of variables</title><link>https://community.appian.com/thread/109158?ContentTypeID=1</link><pubDate>Thu, 09 Mar 2023 22:51:37 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:bbde724d-8865-4328-9827-e06f6903fe2a</guid><dc:creator>MaNa</dc:creator><description>&lt;p&gt;Abhay:&lt;/p&gt;
&lt;p&gt;Thanks for helping me understand this concept. &amp;nbsp;As for the syntax in image&amp;nbsp;2, isn&amp;#39;t the a!localVariable() on line 1, similar to the example in your response?&lt;/p&gt;
&lt;p&gt;Isn&amp;#39;t the scope defined by a!localVariable valid for all statements between matching pairs of ()? &amp;nbsp;So anything you defined after&amp;nbsp;line 1 should be available throughout the rest of the code. &amp;nbsp;Am I wrong in that interpretation ?&lt;/p&gt;
&lt;p&gt;I was using this as the reference (&lt;a href="https://docs.appian.com/suite/help/23.1/Local_Variables.html"&gt;https://docs.appian.com/suite/help/23.1/Local_Variables.html&lt;/a&gt;). &amp;nbsp;In the example they have:&lt;/p&gt;
&lt;pre&gt;&lt;span class="ss"&gt;value:&lt;/span&gt; &lt;span class="nf"&gt;if(isnull&lt;/span&gt;&lt;span class="ow"&gt;(&lt;/span&gt;&lt;span class="k"&gt;local!input&lt;/span&gt;&lt;span class="ow"&gt;),&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;No&amp;quot;&lt;/span&gt;&lt;span class="ow"&gt;,&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;Yes&amp;quot;&lt;/span&gt;&lt;span class="ow"&gt;),&lt;br /&gt; &lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;While I understand I am using &amp;quot;fv!row&amp;quot; not &amp;quot;local!input&amp;quot; as part of showWhen attribute (showWhen:a!isNotNullOrEmpty(fv!row.number)) , it gives me an error (image 1 in original post). &amp;nbsp;I am trying to understand&amp;nbsp;why/when I can use &amp;quot;fv!row&amp;quot; and why there is a scoping error.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!columnsLayout(
  columns: {
    a!localVariables(
      local!input,
      {
        a!columnLayout(
          contents: {
            a!textField(
              label: &amp;quot;Input&amp;quot;,
              value: local!input,
              saveInto: local!input
            )
          }
        ),
        a!columnLayout(
          contents: {
            a!textField(
              label: &amp;quot;Input Entered?&amp;quot;,
              value: if(isnull(local!input), &amp;quot;No&amp;quot;, &amp;quot;Yes&amp;quot;),
              readOnly: true
            )
          }
        )
      }
    )
  }
)
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trying to understand local/scoping of variables</title><link>https://community.appian.com/thread/109157?ContentTypeID=1</link><pubDate>Thu, 09 Mar 2023 22:27:04 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:60590d81-0626-4415-ab91-43c1219e403f</guid><dc:creator>Abhay Dalsaniya</dc:creator><description>&lt;p&gt;Ref.&amp;nbsp;&lt;a href="https://docs.appian.com/suite/help/23.1/fnc_evaluation_a_localvariables.html"&gt;https://docs.appian.com/suite/help/23.1/fnc_evaluation_a_localvariables.html&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trying to understand local/scoping of variables</title><link>https://community.appian.com/thread/109156?ContentTypeID=1</link><pubDate>Thu, 09 Mar 2023 22:24:14 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:01fe4845-e0c6-40c2-8d0c-c6402107ba6a</guid><dc:creator>Abhay Dalsaniya</dc:creator><description>&lt;p&gt;Please try to understand the syntax of a!localVariables().&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;a!localVariables&lt;/strong&gt;&lt;span&gt;(&amp;nbsp;&lt;/span&gt;&lt;em&gt;&lt;span style="background-color:#ccffcc;"&gt;localVar1, localVarN&lt;/span&gt;, &lt;span style="background-color:#ffff99;"&gt;expression&lt;/span&gt;&lt;/em&gt;&lt;span&gt;&lt;span style="background-color:#ffff99;"&gt;&amp;nbsp;&lt;/span&gt;)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;In your image2, you have defined &lt;span style="background-color:#ccffcc;"&gt;local!productsList&lt;/span&gt; without using localVariable()&amp;nbsp;which is violating the syntax because it is the &lt;span style="background-color:#ffff99;"&gt;expression&lt;/span&gt; portion.&lt;/p&gt;
&lt;p&gt;use something like following.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  {
    a!localVariables(
      local!productList: rule!abc(),
      a!gridField()
    )
  }
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;See the color coding to understand it better.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trying to understand local/scoping of variables</title><link>https://community.appian.com/thread/109155?ContentTypeID=1</link><pubDate>Thu, 09 Mar 2023 22:17:38 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:5f4b8576-2491-423f-9731-0dd979446b78</guid><dc:creator>Abhay Dalsaniya</dc:creator><description>&lt;p&gt;looks like fv!raw can only be used in the value parameter. Remove it from&amp;nbsp;showWhen:a!isNotNullOrEmpty(fv!row.firstName)&lt;/p&gt;
&lt;p&gt;Instead do following.&lt;/p&gt;
&lt;p&gt;1. Define local variable (e.g. local!data) and capture the query result set into it.&lt;/p&gt;
&lt;p&gt;2. Refer &lt;span&gt;local!data&amp;nbsp;&lt;/span&gt;into&amp;nbsp;gridField -&amp;gt; data.&lt;/p&gt;
&lt;p&gt;3. For showWhen condition Use&amp;nbsp;&lt;span&gt;local!data.firstName = &amp;lt;something&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trying to understand local/scoping of variables</title><link>https://community.appian.com/thread/109154?ContentTypeID=1</link><pubDate>Thu, 09 Mar 2023 22:15:15 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:00b2e7ac-922b-4aae-82a5-e2669ade2d92</guid><dc:creator>MaNa</dc:creator><description>&lt;p&gt;Abhay,&lt;/p&gt;
&lt;p&gt;That was understanding - variable is available within the defined&amp;nbsp;block. &amp;nbsp;Unless, I am missing something, I don&amp;#39;t see why line 8 in my example (second image in my original post) gives an error when&amp;nbsp;the variable is defined on line 3. &amp;nbsp;However, if I remove the braces on line 2 and 24, the error goes away (see image below).&lt;/p&gt;
&lt;p&gt;Madhu&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/62/pastedimage1678400140851v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trying to understand local/scoping of variables</title><link>https://community.appian.com/thread/109153?ContentTypeID=1</link><pubDate>Thu, 09 Mar 2023 22:06:33 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:1615e974-2079-44b5-944d-35a461f0fa95</guid><dc:creator>MaNa</dc:creator><description>&lt;p&gt;Abhay,&lt;/p&gt;
&lt;p&gt;Here is the code - emblem&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!selection,
  local!selectedEmployees,
  local!showIneligible:true,
  {
    a!checkboxField(
      label: &amp;quot;Checkboxes&amp;quot;,
      labelPosition: &amp;quot;COLLAPSED&amp;quot;,
      choiceLabels: {&amp;quot;Show ineligible employees&amp;quot;},
      choiceValues: {true()},
      value: if(local!showIneligible, true(),null()),
      saveInto: a!save(
        local!showIneligible,
        if(
          isnull(save!value),
          false(),
          true()
        )
      ),
      validations: {}
    ),
  a!columnsLayout(
    columns: {
      a!columnLayout(
        contents: {
          a!gridField(
            label: &amp;quot;Employee Directory&amp;quot;,
            labelPosition: &amp;quot;ABOVE&amp;quot;,
            data: a!queryEntity(
              entity: cons!CR_EMPLOYEE_ENTY_CNST,
              query: a!query(
                selection: a!querySelection(
                  columns: {
                    a!queryColumn(
                      field: &amp;quot;id&amp;quot;
                    ),
                    a!queryColumn(
                      field: &amp;quot;firstName&amp;quot;
                    ),
                    a!queryColumn(
                      field: &amp;quot;lastName&amp;quot;
                    ),
                    a!queryColumn(
                      field: &amp;quot;department&amp;quot;
                    ),
                    a!queryColumn(
                      field: &amp;quot;startDate&amp;quot;
                    )
                  }
                ),
                logicalExpression: a!queryLogicalExpression(
                  operator: &amp;quot;AND&amp;quot;,
                  filters: {
                    a!queryFilter(
                      field: &amp;quot;department&amp;quot;,
                      operator: &amp;quot;&amp;lt;&amp;gt;&amp;quot;,
                      value: &amp;quot;Sales&amp;quot;,
                      applyWhen: not(local!showIneligible)
                    )
                  },
                  ignoreFiltersWithEmptyValues: true
                ),
                pagingInfo: fv!pagingInfo
              ),
              fetchTotalCount: true
            ),
            columns: {
              a!gridColumn(
                label: &amp;quot;First Name&amp;quot;,
                sortField: &amp;quot;firstName&amp;quot;,
                value: fv!row.firstName,
                showWhen:a!isNotNullOrEmpty(fv!row.firstName)
              ),
              a!gridColumn(
                label: &amp;quot;Last Name&amp;quot;,
                sortField: &amp;quot;lastName&amp;quot;,
                value: fv!row.lastName
                /*showWhen:a!isNotNullOrEmpty(fv!row.lastName)*/
              ),
              a!gridColumn(
                label: &amp;quot;Department&amp;quot;,
                sortField: &amp;quot;department&amp;quot;,
                value: a!richTextDisplayField(
                  value: {
                    a!richTextItem(
                      text: {fv!row.department},
                      color: if(fv!row.department=&amp;quot;Sales&amp;quot;,&amp;quot;SECONDARY&amp;quot;,null),
                      style: {
                        &amp;quot;EMPHASIS&amp;quot;
                      }
                    )
                  }
                )
              ),
              a!gridColumn(
                label: &amp;quot;Start Date&amp;quot;,
                sortField: &amp;quot;startDate&amp;quot;,
                value: if(
                isnull(fv!row.startDate),
                fv!row.startDate,
                datetext(fv!row.startDate, &amp;quot;default&amp;quot;)
                ),
                align: &amp;quot;END&amp;quot;
              ),
              a!gridColumn(
                label: &amp;quot;Id&amp;quot;,
                sortField: &amp;quot;id&amp;quot;,
                value: fv!row.id,
                align: &amp;quot;END&amp;quot;
              )
            },
            initialSorts: {
              a!sortInfo(
                field: &amp;quot;lastName&amp;quot;,
                ascending: true
              )
            },
            selectable: true,
            selectionValue: local!selection,
            selectionSaveInto: {
              local!selection,

              /* This save adds the full rows of data for items selected in the most recent user interaction to local!selectedEmployees. */
              a!save(local!selectedEmployees, append(local!selectedEmployees,fv!selectedRows)),
              /* This save removes the full rows of data for items deselected in the most recent user interaction to local!selectedEmployees */
              a!save(local!selectedEmployees, difference(local!selectedEmployees,fv!deselectedRows))
            },
            disableRowSelectionWhen: fv!row.department=&amp;quot;Sales&amp;quot;,
            validations: {}
          )
        },
        width: &amp;quot;WIDE&amp;quot;
      ),
      a!columnLayout(
        contents: {
          a!richTextDisplayField(
            label: &amp;quot;Selected Employees&amp;quot;,
            labelPosition: &amp;quot;ABOVE&amp;quot;,
            value: a!forEach(
              items:local!selectedEmployees,
              expression: {
                a!richTextIcon(
                  icon:&amp;quot;user-circle&amp;quot;
                ),
                &amp;quot; &amp;quot; &amp;amp; fv!item.firstName &amp;amp; &amp;quot; &amp;quot; &amp;amp; fv!item.lastName &amp;amp; char(10)
              }
            )
          )
        }
      )
    }
  )
}
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trying to understand local/scoping of variables</title><link>https://community.appian.com/thread/109152?ContentTypeID=1</link><pubDate>Thu, 09 Mar 2023 22:01:41 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:04847442-521d-4830-a560-b7014dfa9b65</guid><dc:creator>Abhay Dalsaniya</dc:creator><description>&lt;p&gt;It&amp;#39;s simple.&amp;nbsp;The variable is accessible within the block into which it is defined.&lt;/p&gt;
&lt;p&gt;See the following to understand it better -&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-discussions-components-files/62/pastedimage1678399325568v2.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!a: 1,
  {
    a!localVariables(local!b: 2, local!a),
    local!b
  }
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trying to understand local/scoping of variables</title><link>https://community.appian.com/thread/109151?ContentTypeID=1</link><pubDate>Thu, 09 Mar 2023 21:54:01 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:049e0eba-a88c-46a0-84c7-11c9ab3e98a5</guid><dc:creator>Abhay Dalsaniya</dc:creator><description>&lt;p&gt;Can you post your code using following instead of the image.&lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image/__size/640x480/__key/communityserver-discussions-components-files/62/pastedimage1678398898828v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>