<?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>Cannot enumerate non-scalar. a!hierarchybrowsertreefield</title><link>https://community.appian.com/discussions/f/user-interface/37791/cannot-enumerate-non-scalar-a-hierarchybrowsertreefield</link><description>Interface Definition: Expression evaluation error at function a!hierarchyBrowserFieldTree [line 31]: A tree browser component [label=&amp;quot;&amp;quot;] encountered an error for &amp;quot;nextLevelValues&amp;quot; when fv!nodeValue was [id:0,name:JobType,description:Description for node</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Cannot enumerate non-scalar. a!hierarchybrowsertreefield</title><link>https://community.appian.com/thread/141971?ContentTypeID=1</link><pubDate>Tue, 22 Oct 2024 13:22:16 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:dc50e821-245c-470a-9264-4cb2c1179c90</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;I suspect the issue to be in line 15. Using wherecontains() will always return a ist of items.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cannot enumerate non-scalar. a!hierarchybrowsertreefield</title><link>https://community.appian.com/thread/141970?ContentTypeID=1</link><pubDate>Tue, 22 Oct 2024 13:18:18 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:c588cdba-cfe8-4dc2-833b-8a5e3a0b57a8</guid><dc:creator>Akshat Lakhera</dc:creator><description>&lt;p&gt;Try replacing&amp;nbsp;fv!nodeValue.numberOfChildren with&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;tointeger({fv!nodeValue.numberOfChildren})&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cannot enumerate non-scalar. a!hierarchybrowsertreefield</title><link>https://community.appian.com/thread/141969?ContentTypeID=1</link><pubDate>Tue, 22 Oct 2024 13:10:54 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:b5ae4ae8-aefe-4efb-8365-14b2047de049</guid><dc:creator>Soma</dc:creator><description>&lt;p&gt;There could be a possibility that fv!nodeValue.numberOfChildren is taken as list. Casting it to integer should solve it. Please replace the code items of foreach()&lt;pre class="ui-code" data-mode="text"&gt;if(
isnull(fv!nodeValue.numberOfChildren),
enumerate(0),
enumerate(cast(1,fv!nodeValue.numberOfChildren))
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cannot enumerate non-scalar. a!hierarchybrowsertreefield</title><link>https://community.appian.com/thread/141968?ContentTypeID=1</link><pubDate>Tue, 22 Oct 2024 12:53:38 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f2a83084-5ba6-4396-bb3b-d30752af6358</guid><dc:creator>harishv147790</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt; a!hierarchyBrowserFieldTree(
      pathValue: local!path,
      pathSaveInto: local!path,
      nextLevelValues: 
      
     a!forEach(
        /* Make a number of values in the next level equal to the number of children */
        items: if(
          isnull(fv!nodeValue.numberOfChildren),
          enumerate(0),
          enumerate(fv!nodeValue.numberOfChildren)
        ),
        expression: a!localVariables(
          /* Give the new node a random number of children between 0 and 10 */
          local!numberOfChildren: wherecontains(
            tointeger(
              index(
                local!jobFunction,
                &amp;#39;recordType!{1ff9ad37-4289-4671-993e-73ee3f4cffff}CRI Function.fields.{5eeb91de-e4fd-4d7c-9cc3-ddb20eac48ee}id&amp;#39;,
                {}
              )
            )[fv!index],
            tointeger(
              index(
                local!jobFamilyGroup,
                &amp;#39;recordType!{0ac046d5-58a9-4d1e-8c9c-19b64a5a95c9}CRI JF Group.fields.{a021ee14-ea90-44e2-8b54-1bc298294834}jfgid&amp;#39;,
                {}
              )
            )
          ),
          /* Make only even nodes drillable */
          local!isDrillable: true(),
          {
            a!map(
              id: fv!item,
              name: index(
                local!jobFunction,
                &amp;#39;recordType!{1ff9ad37-4289-4671-993e-73ee3f4cffff}CRI Function.fields.{a11ba965-2b5a-4a8b-9b31-6baad64974f0}functiontype&amp;#39;,
                {}
              )[fv!index],
              description: &amp;quot;Description for node &amp;quot; &amp;amp; index(
                local!jobFunction,
                &amp;#39;recordType!{1ff9ad37-4289-4671-993e-73ee3f4cffff}CRI Function.fields.{a11ba965-2b5a-4a8b-9b31-6baad64974f0}functiontype&amp;#39;,
                {}
              )[fv!index],
              details: if(
                local!isDrillable,
                if(
                  length(local!numberOfChildren) = 1,
                  &amp;quot;I have 1 child node&amp;quot;,
                  &amp;quot;I have &amp;quot; &amp;amp; length(local!numberOfChildren) &amp;amp; &amp;quot; child nodes&amp;quot;
                ),
                &amp;quot;I am not drillable&amp;quot;
              ),
              type: if(
                fv!nodeValue.type = &amp;quot;AIRPLANE&amp;quot;,
                &amp;quot;FOUNTAIN_PEN&amp;quot;,
                &amp;quot;AIRPLANE&amp;quot;
              ),
              numberOfChildren: local!numberOfChildren,
              isDrillable: true()
            )
          }
        )
      ),
      nodeConfigs: a!hierarchyBrowserFieldTreeNode(
        id: fv!nodeValue.id,
        label: fv!nodeValue.name,
        description: fv!nodeValue.description,
        details: fv!nodeValue.details,
        image: a!documentImage(
          document: if(
            fv!nodeValue.type = &amp;quot;AIRPLANE&amp;quot;,
            a!iconNewsEvent(&amp;quot;PAPER_AIRPLANE&amp;quot;),
            a!iconNewsEvent(&amp;quot;FOUNTAIN_PEN&amp;quot;)
          )
        ),
        isDrillable: fv!nodeValue.isDrillable,
        nextLevelCount: fv!nodeValue.numberOfChildren
      )
    )&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Please refer once&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cannot enumerate non-scalar. a!hierarchybrowsertreefield</title><link>https://community.appian.com/thread/141967?ContentTypeID=1</link><pubDate>Tue, 22 Oct 2024 12:37:55 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:083bfbb4-10ed-4bb8-85a7-03b97e4faf0a</guid><dc:creator>Soma</dc:creator><description>&lt;p&gt;Can you share the code for more information&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cannot enumerate non-scalar. a!hierarchybrowsertreefield</title><link>https://community.appian.com/thread/141966?ContentTypeID=1</link><pubDate>Tue, 22 Oct 2024 12:26:40 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f2db60dd-b7cd-49d9-bd6f-63eaad02a304</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;&amp;quot;Scalar&amp;quot; data is any singular value like a single integer or text. &amp;quot;Non-scalar&amp;quot; means this is a list of some sort.&lt;/p&gt;
&lt;p&gt;enumerate() can on work this scalar values.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>