<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: &amp;quot;Warning The expression must return a number value.&amp;quot; in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/quot-warning-the-expression-must-return-a-number/m-p/1152993#M44838</link>
    <description>&lt;P&gt;Your &lt;STRONG&gt;$feature.Affiliation &lt;/STRONG&gt;attribute is a &lt;EM&gt;string&lt;/EM&gt;, so using &lt;STRONG&gt;Count&lt;/STRONG&gt; on it is giving you the &lt;EM&gt;length of the string&lt;/EM&gt;. In your test, that's just telling you that the text "Baha'i" is 6 characters long.&lt;/P&gt;&lt;P&gt;In order to get the count of &lt;EM&gt;features&lt;/EM&gt;, you need to use the function against a &lt;STRONG&gt;FeatureSet&lt;/STRONG&gt;, rather than a single feature. Your mention of the legend suggests you're doing this in the symbology settings? If so, there is unfortunately no way to access your other features in the symbology profile of Arcade.&lt;/P&gt;&lt;P&gt;What you're attempting is certainly possible elsewhere, but not in the symbology / legend.&lt;/P&gt;&lt;P&gt;As far as the error you're getting, that's generally the error you get when you attempt to add two non-numeric attributes to your symbology settings. You can add 2 or more fields to your symbology settings, but only if the additional fields are &lt;EM&gt;numeric&lt;/EM&gt;. That's less to do with Arcade than the symbology settings in the web maps in general.&lt;/P&gt;</description>
    <pubDate>Fri, 11 Mar 2022 17:07:40 GMT</pubDate>
    <dc:creator>jcarlson</dc:creator>
    <dc:date>2022-03-11T17:07:40Z</dc:date>
    <item>
      <title>"Warning The expression must return a number value."</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/quot-warning-the-expression-must-return-a-number/m-p/1152987#M44837</link>
      <description>&lt;P&gt;Good morning all.&amp;nbsp; I know nothing about Arcade, and what I thought would be a straight forward code, has not turned out that way.&amp;nbsp; I have an AGOL map that I created a web map from.&amp;nbsp; It consists of a feature service of houses of worship.&amp;nbsp; There is a field in the att table called Affiliation.&amp;nbsp; All I want to do in the legend is show :&lt;/P&gt;&lt;P&gt;Affiliation Name / number of affiliations&lt;/P&gt;&lt;P&gt;where the "Affiliation Name" is an entry in the Affiliation field of the att table, and "number of affiliations" is the total count number of each different affiliation.&amp;nbsp; What I am striving for is:&lt;/P&gt;&lt;P&gt;Buddhist&amp;nbsp; / 2&lt;/P&gt;&lt;P&gt;Catholic&amp;nbsp; / 7&lt;/P&gt;&lt;P&gt;Etc.&lt;/P&gt;&lt;P&gt;My Arcade code is:&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;($feature.Affiliation) + " " + TextFormatting.ForwardSlash + " " + Count($feature.Affiliation)&lt;/P&gt;&lt;P&gt;When I click TEST, it looks exactly what I want:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="CatherineBradley2_0-1647017250918.png" style="width: 218px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/36152i9646C157ACD238F6/image-dimensions/218x153?v=v2" width="218" height="153" role="button" title="CatherineBradley2_0-1647017250918.png" alt="CatherineBradley2_0-1647017250918.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Being overjoyed I figured something out, I gleefully clicked OK, only to have my Arcade scripting skills dashed when I got the disheartening message of:&lt;/P&gt;&lt;DIV&gt;Warning&lt;/DIV&gt;&lt;DIV&gt;The expression must return a number value.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I have been on Google, AGOL help, &amp;amp; Arcade Help, and unfortunately I cannot find anything relating to me.&amp;nbsp; Any help would be appreciated.&amp;nbsp; &amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;And one more question about AGOL web map/app:&amp;nbsp; Does what appears in the popup always appear in the legend and vice versa?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thanks, Catherine&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Fri, 11 Mar 2022 16:59:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/quot-warning-the-expression-must-return-a-number/m-p/1152987#M44837</guid>
      <dc:creator>CatherineBradley2</dc:creator>
      <dc:date>2022-03-11T16:59:24Z</dc:date>
    </item>
    <item>
      <title>Re: "Warning The expression must return a number value."</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/quot-warning-the-expression-must-return-a-number/m-p/1152993#M44838</link>
      <description>&lt;P&gt;Your &lt;STRONG&gt;$feature.Affiliation &lt;/STRONG&gt;attribute is a &lt;EM&gt;string&lt;/EM&gt;, so using &lt;STRONG&gt;Count&lt;/STRONG&gt; on it is giving you the &lt;EM&gt;length of the string&lt;/EM&gt;. In your test, that's just telling you that the text "Baha'i" is 6 characters long.&lt;/P&gt;&lt;P&gt;In order to get the count of &lt;EM&gt;features&lt;/EM&gt;, you need to use the function against a &lt;STRONG&gt;FeatureSet&lt;/STRONG&gt;, rather than a single feature. Your mention of the legend suggests you're doing this in the symbology settings? If so, there is unfortunately no way to access your other features in the symbology profile of Arcade.&lt;/P&gt;&lt;P&gt;What you're attempting is certainly possible elsewhere, but not in the symbology / legend.&lt;/P&gt;&lt;P&gt;As far as the error you're getting, that's generally the error you get when you attempt to add two non-numeric attributes to your symbology settings. You can add 2 or more fields to your symbology settings, but only if the additional fields are &lt;EM&gt;numeric&lt;/EM&gt;. That's less to do with Arcade than the symbology settings in the web maps in general.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Mar 2022 17:07:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/quot-warning-the-expression-must-return-a-number/m-p/1152993#M44838</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2022-03-11T17:07:40Z</dc:date>
    </item>
    <item>
      <title>Re: "Warning The expression must return a number value."</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/quot-warning-the-expression-must-return-a-number/m-p/1303952#M53138</link>
      <description>&lt;P&gt;Hi Josh,&lt;/P&gt;&lt;P&gt;Thank you for the reply. Are you saying that Arcade can't be used to symbolize by two string fields? This seems odd - it feels like my expression should be able to yield good results. I got the same error with the expression below.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Henry_PeleshBW_0-1687965616403.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/74377i1C25D2A49DBE272A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Henry_PeleshBW_0-1687965616403.png" alt="Henry_PeleshBW_0-1687965616403.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/user/viewprofilepage/user-id/17874" target="_blank"&gt;@RussRoberts&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Jun 2023 15:23:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/quot-warning-the-expression-must-return-a-number/m-p/1303952#M53138</guid>
      <dc:creator>Henry_PeleshBW</dc:creator>
      <dc:date>2023-06-28T15:23:07Z</dc:date>
    </item>
    <item>
      <title>Re: "Warning The expression must return a number value."</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/quot-warning-the-expression-must-return-a-number/m-p/1303958#M53140</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/17874"&gt;@RussRoberts&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sometimes all you need is to investigate a little deeper! (:&lt;/P&gt;&lt;P&gt;I got this to work properly using the script below. Just a simple change to establish a variable to return the results. Sorry for the bother!&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Henry_PeleshBW_0-1687965983477.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/74378iA2465ABD3CB8703F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Henry_PeleshBW_0-1687965983477.png" alt="Henry_PeleshBW_0-1687965983477.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Henry_PeleshBW_1-1687966056584.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/74379i7B515B5158D287B4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Henry_PeleshBW_1-1687966056584.png" alt="Henry_PeleshBW_1-1687966056584.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Jun 2023 15:27:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/quot-warning-the-expression-must-return-a-number/m-p/1303958#M53140</guid>
      <dc:creator>Henry_PeleshBW</dc:creator>
      <dc:date>2023-06-28T15:27:41Z</dc:date>
    </item>
    <item>
      <title>Re: "Warning The expression must return a number value."</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/quot-warning-the-expression-must-return-a-number/m-p/1350341#M55913</link>
      <description>&lt;P&gt;My frustration knows no bounds with ESRI.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Nov 2023 17:25:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/quot-warning-the-expression-must-return-a-number/m-p/1350341#M55913</guid>
      <dc:creator>EricPescatore</dc:creator>
      <dc:date>2023-11-16T17:25:36Z</dc:date>
    </item>
  </channel>
</rss>

