<?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: Dashboard data expression only returning one value in ArcGIS Dashboards Questions</title>
    <link>https://community.esri.com/t5/arcgis-dashboards-questions/dashboard-data-expression-only-returning-one-value/m-p/1393436#M9257</link>
    <description>&lt;P&gt;Yep that was it.&amp;nbsp; I knew it was going something easy like that.&amp;nbsp; I really appreciate you getting a second pair of eyes on it and getting back to me.&amp;nbsp; Have a great weekend!&lt;/P&gt;</description>
    <pubDate>Fri, 08 Mar 2024 21:00:37 GMT</pubDate>
    <dc:creator>ScottFortman1</dc:creator>
    <dc:date>2024-03-08T21:00:37Z</dc:date>
    <item>
      <title>Dashboard data expression only returning one value</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/dashboard-data-expression-only-returning-one-value/m-p/1393357#M9254</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;I've been working on a data expression that creates a data dictionary using some existing fire hydrant fields to calculate a value for a new field.&amp;nbsp; I have the expression mostly working but it is only returning one feature.&amp;nbsp; &amp;nbsp;I don't have any filters in my featureset and when I return the variable for Hydrants with the rest of the expression commented out, it returns all the features. I've done similar dictionaries in past without calculating a new value and have worked fine,&amp;nbsp; I just cant figure out what I'm missing here.&amp;nbsp; The resulting table should have a new field for PSI difference, calculated by the difference in Calculated PSI and Measured PSI.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ArcGIS Enterprise 10.9.1&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var tvwdportal = Portal('https://mapping.tvwd.org/portal')
var Hydrants = FeatureSetByPortalItem(tvwdportal,"b24772e427084f21b1f208a685d07fcc",5,['MaintainedBy','LifeCycleStatus','CalcStaticPSI','MeasuredStaticPSI', 'UniqueID'],True) ;


    
var out_dict = {
    'fields':[{name: 'PSIDifference', type: 'esriFieldTypeInteger'},
              {name: 'CalculatedPSI', type: 'esriFieldTypeInteger'},
              {name: 'MeasuredPSI', type: 'esriFieldTypeInteger'}],
    'geometryType': '',
    'features': []}



for (var f in Hydrants) {
    var f_CalcStaticPSI = Number(f['CalcStaticPSI'])
    var f_MeasuredPSI = Number(f['MeasuredStaticPSI'])
    var f_PSIDifference = Number(sum(f['CalcStaticPSI']- f['MeasuredStaticPSI']))
    
}
Push(out_dict['features'], {'attributes': {'CalculatedPSI':f_CalcStaticPSI,'MeasuredPSI': f_MeasuredPSI,'PSIDifference':f_PSIDifference}})

console(out_dict)
return FeatureSet(Text(out_dict))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Mar 2024 18:55:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/dashboard-data-expression-only-returning-one-value/m-p/1393357#M9254</guid>
      <dc:creator>ScottFortman1</dc:creator>
      <dc:date>2024-03-08T18:55:01Z</dc:date>
    </item>
    <item>
      <title>Re: Dashboard data expression only returning one value</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/dashboard-data-expression-only-returning-one-value/m-p/1393394#M9255</link>
      <description>&lt;P&gt;Line 21 should be inside the for loop.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;for (var f in Hydrants) {
    var f_CalcStaticPSI = Number(f['CalcStaticPSI'])
    var f_MeasuredPSI = Number(f['MeasuredStaticPSI'])
    var f_PSIDifference = Number(sum(f['CalcStaticPSI']- f['MeasuredStaticPSI']))
    Push(out_dict['features'], {'attributes': {'CalculatedPSI':f_CalcStaticPSI,'MeasuredPSI': f_MeasuredPSI,'PSIDifference':f_PSIDifference}})
}
&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 08 Mar 2024 19:51:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/dashboard-data-expression-only-returning-one-value/m-p/1393394#M9255</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2024-03-08T19:51:26Z</dc:date>
    </item>
    <item>
      <title>Re: Dashboard data expression only returning one value</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/dashboard-data-expression-only-returning-one-value/m-p/1393436#M9257</link>
      <description>&lt;P&gt;Yep that was it.&amp;nbsp; I knew it was going something easy like that.&amp;nbsp; I really appreciate you getting a second pair of eyes on it and getting back to me.&amp;nbsp; Have a great weekend!&lt;/P&gt;</description>
      <pubDate>Fri, 08 Mar 2024 21:00:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/dashboard-data-expression-only-returning-one-value/m-p/1393436#M9257</guid>
      <dc:creator>ScottFortman1</dc:creator>
      <dc:date>2024-03-08T21:00:37Z</dc:date>
    </item>
  </channel>
</rss>

