<?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 esriFieldTypeDate in Data Expression in Dashboard doesn't work in ArcGIS Dashboards Questions</title>
    <link>https://community.esri.com/t5/arcgis-dashboards-questions/esrifieldtypedate-in-data-expression-in-dashboard/m-p/1234778#M7026</link>
    <description>&lt;P&gt;Im creating a feature set using a data expression in a dashboard.&amp;nbsp; Its all pretty straightforward stuff.&lt;/P&gt;&lt;P&gt;I've created a dictionary with just four fields.&amp;nbsp; Two strings, a double and a date field&lt;/P&gt;&lt;LI-CODE lang="c"&gt;//there is a heap of stuff before this, but you get the idea.  I've created some variables and populated a dictionary with them
var new_features_dictionary = {
    'geometryType': '',
    'fields': [
        {'name': 'tasky', 'type': 'esriFieldTypeString'},
        {'name': 'group', 'type': 'esriFieldTypeString'},
        {'name': 'hours', 'type': 'esriFieldTypeDouble'},
        {'name': 'datedone', 'type': 'esriFieldTypeDate'}
    ],
    'features': new_feature_list
}

return FeatureSet(text(new_features_dictionary))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The string fields and double field work exactly as expected but no matter what i do i cannot get the date field to populate.&amp;nbsp; All i am doing is taking the date field from an existing feature layer and passing it through to the new feature set.&amp;nbsp; There are no calculations, nothing technical at all.&lt;/P&gt;&lt;P&gt;It seem that&amp;nbsp;esriFieldTypeDate just does not work in data expressions.&amp;nbsp; Please someone tell me this isnt the case.&lt;/P&gt;&lt;P&gt;(p.s yes, i even tried a million different way of converting the date to text and back to date again. When i make the date field a&amp;nbsp;esriFieldTypeString, the feature set populates beautifully.&amp;nbsp; However a text date in a dashboard is completely useless.&amp;nbsp; Im totally out of ideas)&lt;/P&gt;</description>
    <pubDate>Thu, 24 Nov 2022 00:05:17 GMT</pubDate>
    <dc:creator>Scott_Sambell</dc:creator>
    <dc:date>2022-11-24T00:05:17Z</dc:date>
    <item>
      <title>esriFieldTypeDate in Data Expression in Dashboard doesn't work</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/esrifieldtypedate-in-data-expression-in-dashboard/m-p/1234778#M7026</link>
      <description>&lt;P&gt;Im creating a feature set using a data expression in a dashboard.&amp;nbsp; Its all pretty straightforward stuff.&lt;/P&gt;&lt;P&gt;I've created a dictionary with just four fields.&amp;nbsp; Two strings, a double and a date field&lt;/P&gt;&lt;LI-CODE lang="c"&gt;//there is a heap of stuff before this, but you get the idea.  I've created some variables and populated a dictionary with them
var new_features_dictionary = {
    'geometryType': '',
    'fields': [
        {'name': 'tasky', 'type': 'esriFieldTypeString'},
        {'name': 'group', 'type': 'esriFieldTypeString'},
        {'name': 'hours', 'type': 'esriFieldTypeDouble'},
        {'name': 'datedone', 'type': 'esriFieldTypeDate'}
    ],
    'features': new_feature_list
}

return FeatureSet(text(new_features_dictionary))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The string fields and double field work exactly as expected but no matter what i do i cannot get the date field to populate.&amp;nbsp; All i am doing is taking the date field from an existing feature layer and passing it through to the new feature set.&amp;nbsp; There are no calculations, nothing technical at all.&lt;/P&gt;&lt;P&gt;It seem that&amp;nbsp;esriFieldTypeDate just does not work in data expressions.&amp;nbsp; Please someone tell me this isnt the case.&lt;/P&gt;&lt;P&gt;(p.s yes, i even tried a million different way of converting the date to text and back to date again. When i make the date field a&amp;nbsp;esriFieldTypeString, the feature set populates beautifully.&amp;nbsp; However a text date in a dashboard is completely useless.&amp;nbsp; Im totally out of ideas)&lt;/P&gt;</description>
      <pubDate>Thu, 24 Nov 2022 00:05:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/esrifieldtypedate-in-data-expression-in-dashboard/m-p/1234778#M7026</guid>
      <dc:creator>Scott_Sambell</dc:creator>
      <dc:date>2022-11-24T00:05:17Z</dc:date>
    </item>
    <item>
      <title>Re: esriFieldTypeDate in Data Expression in Dashboard doesn't work</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/esrifieldtypedate-in-data-expression-in-dashboard/m-p/1234782#M7027</link>
      <description>&lt;P&gt;Nevermind.&amp;nbsp; I figured it out.&amp;nbsp;&lt;/P&gt;&lt;P&gt;You have to put number() before the variable if you want to populate a date field.&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var new_record = {
                'attributes':{
                    'hours': f['totalhours'],
                    'group': f['groupnameland'],
                  'datedone': number(f['datetask']),
//etc....&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Who knew right?&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":face_with_rolling_eyes:"&gt;🙄&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Nov 2022 00:32:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/esrifieldtypedate-in-data-expression-in-dashboard/m-p/1234782#M7027</guid>
      <dc:creator>Scott_Sambell</dc:creator>
      <dc:date>2022-11-24T00:32:28Z</dc:date>
    </item>
    <item>
      <title>Re: esriFieldTypeDate in Data Expression in Dashboard doesn't work</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/esrifieldtypedate-in-data-expression-in-dashboard/m-p/1234821#M7028</link>
      <description>&lt;P&gt;Glad that you got it to work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;Who knew right?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;Almost nobody. This is a problem that regularily trips up users both new and experienced. It's a completely illogical design decision that noone expects (and neither should they).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I'm just gonna plug my Idea about this here, I'm glad for everyone that lends their support to it:&lt;/SPAN&gt;&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" target="_blank"&gt;Arcade: Allow Date() values in date fields (esriFi... - Esri Community&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Nov 2022 07:16:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/esrifieldtypedate-in-data-expression-in-dashboard/m-p/1234821#M7028</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2022-11-24T07:16:17Z</dc:date>
    </item>
    <item>
      <title>Re: esriFieldTypeDate in Data Expression in Dashboard doesn't work</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/esrifieldtypedate-in-data-expression-in-dashboard/m-p/1238067#M7057</link>
      <description>&lt;P&gt;How are you going Scott? How did you figure this out? This may be the stumbling block that is tripping up my expression. Going to see if this works before I post my issue here. I probably will post anyway but this may get me further along!&lt;/P&gt;</description>
      <pubDate>Tue, 06 Dec 2022 01:34:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/esrifieldtypedate-in-data-expression-in-dashboard/m-p/1238067#M7057</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2022-12-06T01:34:13Z</dc:date>
    </item>
    <item>
      <title>Re: esriFieldTypeDate in Data Expression in Dashboard doesn't work</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/esrifieldtypedate-in-data-expression-in-dashboard/m-p/1299932#M7956</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:25:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/esrifieldtypedate-in-data-expression-in-dashboard/m-p/1299932#M7956</guid>
      <dc:creator>DavidNyenhuis1</dc:creator>
      <dc:date>2023-06-15T19:25:15Z</dc:date>
    </item>
  </channel>
</rss>

