<?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: Geometry is not a Function? in ArcGIS Dashboards Questions</title>
    <link>https://community.esri.com/t5/arcgis-dashboards-questions/geometry-is-not-a-function/m-p/1223605#M6916</link>
    <description>&lt;P&gt;It's in line 15. The parameter is &lt;STRONG&gt;includeGeometry&lt;/STRONG&gt;, and you don't actually need to explicitly reference it, you can just put "false".&lt;/P&gt;&lt;P&gt;The problem you're seeing is that in line 15, you're actually &lt;EM&gt;setting &lt;STRONG&gt;geometry&lt;/STRONG&gt; to &lt;STRONG&gt;false&lt;/STRONG&gt;. &lt;/EM&gt;So later in your expression when you try using Geometry(f), that's equivalent to typing "false(f)", which won't do anything. So you get that "not a function" error because you've overwritten the function with a boolean.&lt;/P&gt;&lt;P&gt;Adjust line 15 and see how it runs.&lt;/P&gt;</description>
    <pubDate>Wed, 19 Oct 2022 21:58:49 GMT</pubDate>
    <dc:creator>jcarlson</dc:creator>
    <dc:date>2022-10-19T21:58:49Z</dc:date>
    <item>
      <title>Geometry is not a Function?</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/geometry-is-not-a-function/m-p/1223587#M6915</link>
      <description>&lt;P&gt;When building a FeatureSet in the data expression I am trying to use geometry but it says that Geometry is not a valid function for some reason? Like umm its right there dude.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DougBrowning_0-1666213969213.png" style="width: 528px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/54003i9AF323159CC96384/image-dimensions/528x124?v=v2" width="528" height="124" role="button" title="DougBrowning_0-1666213969213.png" alt="DougBrowning_0-1666213969213.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Here is the code.&amp;nbsp; I found a post showing this but so weird on the function.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var Dict = {  
    'fields': [{ 'name': 'Project', 'type': 'esriFieldTypeString' },
            { 'name': 'PointID', 'type': 'esriFieldTypeString' },
            { 'name': 'StreamName', 'type': 'esriFieldTypeString' },
            { 'name': 'PointType', 'type': 'esriFieldTypeString' },
            { 'name': 'OrderCode', 'type': 'esriFieldTypeString' },
            { 'name': 'EvalStatus', 'type': 'esriFieldTypeString' },
            { 'name': 'Trip', 'type': 'esriFieldTypeString' },
            { 'name': 'CountUnresolved', 'type': 'esriFieldTypeString' }],  
    'geometryType': 'esriGeometryPoint',   
    'features': []};  
var index = 0;

var sql2 = "ResponseType = 'Log an issue' And (Resolved IS NULL Or Resolved = 'No')"
var tbl2All = Filter(FeatureSetByPortalItem(Portal(p),'713e3aaef9674e3493a64347d333b618',10,['PointID','ResponseType','Resolved'],geometry = false), sql2);
var tbl2text = ""
for (var i in tbl2All) {
    tbl2text = tbl2text + ", " + i.PointID
}

var isUnresolved = ''
//Cycles through each record in the input table
for (var f in tbl) {
    if (Find(f.PointID, tbl2text) &amp;gt; 0) {
        isUnresolved = 'Yes'
    }
    else {
	isUnresolved = 'No'
    }
     //This section writes values from tbl into output table and then fills the variable fields
    Dict.features[index] = {
        'attributes': {   
            'Project': f.Project,
            'PointID': f.PointID,
            'StreamName': f.StreamName,
            'PointType': f.PointType,
            'OrderCode': f.OrderCode,
            'EvalStatus': f.EvalStatus,
            'Trip': f.Trip,
            'CountUnresolved': isUnresolved
        },
	'geometry': Geometry(f)};   
    ++index;
    
}
return FeatureSet(Text(Dict));&lt;/LI-CODE&gt;&lt;P&gt;thanks for any info&lt;/P&gt;</description>
      <pubDate>Wed, 19 Oct 2022 21:27:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/geometry-is-not-a-function/m-p/1223587#M6915</guid>
      <dc:creator>DougBrowning</dc:creator>
      <dc:date>2022-10-19T21:27:43Z</dc:date>
    </item>
    <item>
      <title>Re: Geometry is not a Function?</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/geometry-is-not-a-function/m-p/1223605#M6916</link>
      <description>&lt;P&gt;It's in line 15. The parameter is &lt;STRONG&gt;includeGeometry&lt;/STRONG&gt;, and you don't actually need to explicitly reference it, you can just put "false".&lt;/P&gt;&lt;P&gt;The problem you're seeing is that in line 15, you're actually &lt;EM&gt;setting &lt;STRONG&gt;geometry&lt;/STRONG&gt; to &lt;STRONG&gt;false&lt;/STRONG&gt;. &lt;/EM&gt;So later in your expression when you try using Geometry(f), that's equivalent to typing "false(f)", which won't do anything. So you get that "not a function" error because you've overwritten the function with a boolean.&lt;/P&gt;&lt;P&gt;Adjust line 15 and see how it runs.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Oct 2022 21:58:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/geometry-is-not-a-function/m-p/1223605#M6916</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2022-10-19T21:58:49Z</dc:date>
    </item>
    <item>
      <title>Re: Geometry is not a Function?</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/geometry-is-not-a-function/m-p/1223649#M6917</link>
      <description>&lt;P&gt;Sorry it actually cut my code off.&amp;nbsp; The top two lines were calling a diff layer that does have geometry turned on.&lt;/P&gt;&lt;P&gt;var p = '&lt;A href="https://arcgis.com/" target="_blank"&gt;https://arcgis.com/&lt;/A&gt;';&lt;BR /&gt;var tbl = FeatureSetByPortalItem(Portal(p),'713e3aaef9674e3493a64347d333b618',0,['Project','PointID','StreamName','PointType','OrderCode','EvalStatus','Trip'],true);&lt;/P&gt;&lt;P&gt;But you are correct that it is includeGeometry.&amp;nbsp; I got that part from some other code that was posted and I never double checked that.&amp;nbsp; How weird it never once complained on it.&lt;/P&gt;&lt;P&gt;The complete code now does work.&amp;nbsp; thanks!&lt;/P&gt;&lt;P&gt;BUT what I wonder is how does this work then - I pass to intersects with no geo and it works fine.&lt;/P&gt;&lt;P&gt;var plots = Intersects($feature,FeatureSetByName($map,"I_Indicators", ["PctFinesLessThan2mm"], false));&lt;BR /&gt;if (Count(plots) == 0) {&lt;BR /&gt;return "no plots in HUC"&lt;BR /&gt;}&lt;BR /&gt;else {&lt;BR /&gt;return Average(plots, "PctFinesLessThan2mm")&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;Is this the other issue we were talking about in the other post that it makes a second call to the layer?&amp;nbsp; Like you were showing.&lt;/P&gt;&lt;P&gt;I have code that does one FeatureSet call then it loops a filter.&amp;nbsp; But not it looks like it does another call for each filter which is super strange.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Oct 2022 23:17:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/geometry-is-not-a-function/m-p/1223649#M6917</guid>
      <dc:creator>DougBrowning</dc:creator>
      <dc:date>2022-10-19T23:17:35Z</dc:date>
    </item>
    <item>
      <title>Re: Geometry is not a Function?</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/geometry-is-not-a-function/m-p/1223653#M6918</link>
      <description>&lt;P&gt;I looked back at my code and I just have false in 99% of my calls this just happened to be code I copied from a post that was wrong I guess.&lt;/P&gt;&lt;P&gt;thanks again.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Oct 2022 23:26:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/geometry-is-not-a-function/m-p/1223653#M6918</guid>
      <dc:creator>DougBrowning</dc:creator>
      <dc:date>2022-10-19T23:26:02Z</dc:date>
    </item>
  </channel>
</rss>

