<?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: Arcade Expression: No values returned by FeatureSet from Dictionary in ArcGIS Dashboards Questions</title>
    <link>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-expression-no-values-returned-by-featureset/m-p/1299928#M7954</link>
    <description>&lt;P&gt;With this week's update to Arcade and ArcGIS Dashboards, date fields in feature set constructors now just work. You no longer have to wrap dates with&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Number()&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;if you pass the &lt;EM&gt;dictionary&lt;/EM&gt; into the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;FeatureSet()&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;function (which as of this release accepts a dictionary as opposed to only text based JSON).&lt;/P&gt;&lt;P&gt;Instead of:&lt;/P&gt;&lt;PRE&gt;return FeatureSet(Text(dict))&lt;/PRE&gt;&lt;P&gt;Do this:&lt;/P&gt;&lt;PRE&gt;return FeatureSet(dict)&lt;/PRE&gt;&lt;P&gt;Learn more in&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.esri.com/t5/arcgis-dashboards-blog/dashboard-data-expressions-what-has-changed-june/ba-p/1298782" target="_blank" rel="noopener"&gt;this blog post&lt;/A&gt;.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;NOTE: For Enterprise users, this update is targeted for 11.2&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 15 Jun 2023 19:21:20 GMT</pubDate>
    <dc:creator>DavidNyenhuis1</dc:creator>
    <dc:date>2023-06-15T19:21:20Z</dc:date>
    <item>
      <title>Arcade Expression: No values returned by FeatureSet from Dictionary</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-expression-no-values-returned-by-featureset/m-p/1204869#M6706</link>
      <description>&lt;P&gt;Hello!&lt;BR /&gt;&lt;BR /&gt;I'm quite new to using data expressions with dashboards. My data contains water sample results and i wanted to assign a value for each period/date ranges. The data was filtered by different date ranges and I assigned them a value and wrote them in a new table.&amp;nbsp;&lt;/P&gt;&lt;P&gt;It worked just fine. However, when I tried to return a FeatureSet from the Dictionary, it's not returning any values even if the dictionary has features. Not sure what I'm missing...&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="palgura_j_2-1661137326749.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/49090i98F9FC297CA7EEB0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="palgura_j_2-1661137326749.png" alt="palgura_j_2-1661137326749.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="palgura_j_1-1661137291847.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/49089i76DA5CB100DC0DC6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="palgura_j_1-1661137291847.png" alt="palgura_j_1-1661137291847.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;Here's the code I wrote for reference:&lt;/P&gt;&lt;P&gt;var periods = [p1, p2, p3, p4, p5];&lt;BR /&gt;var features = [];&lt;BR /&gt;var feat;&lt;/P&gt;&lt;P&gt;var cnt = 0;&lt;BR /&gt;for (var ped in periods) {&lt;BR /&gt;var period = periods[cnt];&lt;BR /&gt;for (var p in period) {&lt;BR /&gt;feat = {&lt;BR /&gt;attributes: {&lt;BR /&gt;'objectid': p['objectid'],&lt;BR /&gt;'assetid': p['assetid'],&lt;BR /&gt;'wzonename': p['wzonename'],&lt;BR /&gt;'reservoir_id': p['reservoir_id'],&lt;BR /&gt;'sp_type': p['sp_type'],&lt;BR /&gt;'sample_date': p['sample_date'],&lt;BR /&gt;'sample_year': p['sample_year'],&lt;BR /&gt;'test_description': p['test_description'],&lt;BR /&gt;'result': p['result'],&lt;BR /&gt;'izparea': p['izparea'],&lt;BR /&gt;'period': 'p'+(cnt+1)&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;Push(features,feat)&lt;BR /&gt;}&lt;BR /&gt;cnt++;&lt;BR /&gt;}&lt;BR /&gt;//return features;&lt;BR /&gt;var samples = {&lt;BR /&gt;'fields':&lt;BR /&gt;[{'name': 'objectid', 'type': 'esriFieldTypeInteger'},&lt;BR /&gt;{'name': 'assetid', 'type': 'esriFieldTypeString'},&lt;BR /&gt;{'name': 'wzonename', 'type': 'esriFieldTypeString'},&lt;BR /&gt;{'name': 'reservoir_id', 'type': 'esriFieldTypeString'},&lt;BR /&gt;{'name': 'sp_type', 'type': 'esriFieldTypeString'},&lt;BR /&gt;{'name': 'sample_date', 'type': 'esriFieldTypeDate'},&lt;BR /&gt;{'name': 'sample_year', 'type': 'esriFieldTypeString'},&lt;BR /&gt;{'name': 'test_description', 'type': 'esriFieldTypeString'},&lt;BR /&gt;{'name': 'result', 'type': 'esriFieldTypeDouble'},&lt;BR /&gt;{'name': 'izparea', 'type': 'esriFieldTypeString'},&lt;BR /&gt;{'name': 'period', 'type': 'esriFieldTypeString'}&lt;BR /&gt;],&lt;BR /&gt;'geometryType': 'esriGeometryPoint',&lt;BR /&gt;'features': features&lt;BR /&gt;};&lt;BR /&gt;//return samples;&lt;BR /&gt;return FeatureSet(Text(samples));&lt;/P&gt;&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Mon, 22 Aug 2022 03:09:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-expression-no-values-returned-by-featureset/m-p/1204869#M6706</guid>
      <dc:creator>pat_algura</dc:creator>
      <dc:date>2022-08-22T03:09:15Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Expression: No values returned by FeatureSet from Dictionary</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-expression-no-values-returned-by-featureset/m-p/1204889#M6707</link>
      <description>&lt;P&gt;To post formatted code:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JohannesLindner_0-1661148750380.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/49100i6FE57C47C5F18697/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JohannesLindner_0-1661148750380.png" alt="JohannesLindner_0-1661148750380.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="JohannesLindner_1-1661148777518.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/49101i5DB5E175A883365A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JohannesLindner_1-1661148777518.png" alt="JohannesLindner_1-1661148777518.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You have a date field in your feature set. For whatever stupid design reason, you can't input Date() values into date fields, you have to convert them to Number() first. I took the opportunity to make your for loop shorter.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var periods = [p1, p2, p3, p4, p5];
var features = [];

for (var cnt in periods) {
    var period = periods[cnt];
    for (var p in period) {
        // get the original attributes
        var copy_attributes = Dictionary(Text(p))['attributes']
        // cast the date to number
        copy_attributes['sample_date'] = Number(copy_attributes['sample_date'])
        // calculate the period
        copy_attributes['period'] = 'p' + (cnt + 1)
        // push into array
        Push(features, {'attributes': copy_attributes})
    }
}
//return features;
var samples = {
    'fields': [
        {'name': 'objectid', 'type': 'esriFieldTypeInteger'},
        {'name': 'assetid', 'type': 'esriFieldTypeString'},
        {'name': 'wzonename', 'type': 'esriFieldTypeString'},
        {'name': 'reservoir_id', 'type': 'esriFieldTypeString'},
        {'name': 'sp_type', 'type': 'esriFieldTypeString'},
        {'name': 'sample_date', 'type': 'esriFieldTypeDate'},
        {'name': 'sample_year', 'type': 'esriFieldTypeString'},
        {'name': 'test_description', 'type': 'esriFieldTypeString'},
        {'name': 'result', 'type': 'esriFieldTypeDouble'},
        {'name': 'izparea', 'type': 'esriFieldTypeString'},
        {'name': 'period', 'type': 'esriFieldTypeString'}
    ],
    'geometryType': 'esriGeometryPoint',
    'features': features
};
//return samples;
return FeatureSet(Text(samples));&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 22 Aug 2022 06:18:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-expression-no-values-returned-by-featureset/m-p/1204889#M6707</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2022-08-22T06:18:27Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Expression: No values returned by FeatureSet from Dictionary</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-expression-no-values-returned-by-featureset/m-p/1204895#M6708</link>
      <description>&lt;P&gt;Just posted an Idea about this, feel free to add your support:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/arcgis-online-ideas/arcade-allow-date-values-in-date-fields/idi-p/1204894/jump-to/first-unread-message" target="_blank"&gt;Arcade: Allow Date() values in date fields (esriFi... - Esri Community&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Aug 2022 06:37:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-expression-no-values-returned-by-featureset/m-p/1204895#M6708</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2022-08-22T06:37:01Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Expression: No values returned by FeatureSet from Dictionary</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-expression-no-values-returned-by-featureset/m-p/1204898#M6709</link>
      <description>&lt;P&gt;Hi Johannes,&lt;BR /&gt;&lt;BR /&gt;That works like a charm - You're heaven sent!&lt;BR /&gt;Yeah, I've seen some other thread with the other users having issues writing Dates too, but didn't expect that was the same issue as mine.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thanks heaps!! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;Have a great day!&lt;/P&gt;</description>
      <pubDate>Mon, 22 Aug 2022 06:44:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-expression-no-values-returned-by-featureset/m-p/1204898#M6709</guid>
      <dc:creator>pat_algura</dc:creator>
      <dc:date>2022-08-22T06:44:57Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Expression: No values returned by FeatureSet from Dictionary</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-expression-no-values-returned-by-featureset/m-p/1204900#M6710</link>
      <description>&lt;P&gt;Glad to help.&lt;/P&gt;&lt;P&gt;Please accept the answer as solution, so that this question gets shown as resolved.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Aug 2022 06:47:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-expression-no-values-returned-by-featureset/m-p/1204900#M6710</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2022-08-22T06:47:48Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade Expression: No values returned by FeatureSet from Dictionary</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-expression-no-values-returned-by-featureset/m-p/1299928#M7954</link>
      <description>&lt;P&gt;With this week's update to Arcade and ArcGIS Dashboards, date fields in feature set constructors now just work. You no longer have to wrap dates with&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Number()&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;if you pass the &lt;EM&gt;dictionary&lt;/EM&gt; into the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;FeatureSet()&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;function (which as of this release accepts a dictionary as opposed to only text based JSON).&lt;/P&gt;&lt;P&gt;Instead of:&lt;/P&gt;&lt;PRE&gt;return FeatureSet(Text(dict))&lt;/PRE&gt;&lt;P&gt;Do this:&lt;/P&gt;&lt;PRE&gt;return FeatureSet(dict)&lt;/PRE&gt;&lt;P&gt;Learn more in&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.esri.com/t5/arcgis-dashboards-blog/dashboard-data-expressions-what-has-changed-june/ba-p/1298782" target="_blank" rel="noopener"&gt;this blog post&lt;/A&gt;.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;NOTE: For Enterprise users, this update is targeted for 11.2&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jun 2023 19:21:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-expression-no-values-returned-by-featureset/m-p/1299928#M7954</guid>
      <dc:creator>DavidNyenhuis1</dc:creator>
      <dc:date>2023-06-15T19:21:20Z</dc:date>
    </item>
  </channel>
</rss>

