<?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: Decimal-date-time not working in web form in ArcGIS Survey123 Questions</title>
    <link>https://community.esri.com/t5/arcgis-survey123-questions/decimal-date-time-not-working-in-web-form/m-p/1538354#M59165</link>
    <description>&lt;P&gt;I had help from Alex at ESRI Canada and finally resolved this. I want users to enter an animal ID and then have the survey pull the animal's birthday from another hosted feature class.&lt;/P&gt;&lt;P&gt;I had to force field types for some fields (decimal and dateTime), then ensure the fields were hidden and readonly = yes (I am going to use the dates in a calculation rather than show them, and this ensures they appear properly in the S123 webapp editor).&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cell that pulls date from hosted feature class is type decimal, and calculation is:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;pulldata("@layer", "getValue", "attributes.animal_date_born", "replace_with_your_hosted_feature_layer_in_AGOL", concat('animal_id=', "'",${animal_id},"'"))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;calculation cell to convert to dateTime is type dateTime and contains:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;date-time(int(${animal_date_born}) div 86400000)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Screenshot:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="EricaNova_0-1726242946956.png" style="width: 855px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/115031i485ECC63875FF882/image-dimensions/855x76?v=v2" width="855" height="76" role="button" title="EricaNova_0-1726242946956.png" alt="EricaNova_0-1726242946956.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;example xlsx form is attached.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 13 Sep 2024 15:59:18 GMT</pubDate>
    <dc:creator>EricaNova</dc:creator>
    <dc:date>2024-09-13T15:59:18Z</dc:date>
    <item>
      <title>Decimal-date-time not working in web form</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/decimal-date-time-not-working-in-web-form/m-p/1158840#M41704</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I was hoping someone could help me as I'm struggling to get dates to work in the web form. I have a survey that is pulling in data using the javascript functionality including some dates, which are coming into my form in epoch time format e.g.&amp;nbsp;1325635200000. After reviewing Ismael's blog post &lt;A href="https://community.esri.com/t5/arcgis-survey123-blog/dates-and-time-in-survey123/ba-p/895528#:~:text=The%20Survey123%20web%20app%20ONLY,decimal%2Ddate%2Dtime%20function." target="_self"&gt;here&lt;/A&gt; and the &lt;A href="https://doc.arcgis.com/en/survey123/desktop/create-surveys/decimaldatetime.htm" target="_self"&gt;help section&lt;/A&gt; on decimal date time I've attempted to convert my epoch date using the decimal-date-time function. My set up can be seen below N.B. I split up the calculations to see where the issue was occurring but originally just had one field with a single combined calculation.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AnthonyJones5_0-1648560934582.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/37574iBFD85ACDADF504CE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AnthonyJones5_0-1648560934582.png" alt="AnthonyJones5_0-1648560934582.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;In Survey123 Connect, this all works fine (see below) but in the web form I find that the&amp;nbsp;decimal-date-time calculation simply won't fire (see second image below).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AnthonyJones5_1-1648561006789.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/37575iDB05671F8AC8A502/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AnthonyJones5_1-1648561006789.png" alt="AnthonyJones5_1-1648561006789.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="AnthonyJones5_2-1648561042313.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/37577i715F3E2CF9EE3AFF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AnthonyJones5_2-1648561042313.png" alt="AnthonyJones5_2-1648561042313.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I've tried various combinations on this and none of them seem to work. I even went back and tried the example Ismael proposed in his blog post below and had no joy with this. Can someone please look at this and let me know if I'm doing anything wrong or is there currently a bug in the S123 web form that is preventing this from working? Any help on this would be very much appreciated. Thanks, Anthony&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AnthonyJones5_3-1648561130287.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/37578i6D788B4539345D42/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AnthonyJones5_3-1648561130287.png" alt="AnthonyJones5_3-1648561130287.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/2929"&gt;@IsmaelChivite&lt;/a&gt;&amp;nbsp;@Anonymous User&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Mar 2022 13:43:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/decimal-date-time-not-working-in-web-form/m-p/1158840#M41704</guid>
      <dc:creator>AnthonyJonesRSK</dc:creator>
      <dc:date>2022-03-29T13:43:00Z</dc:date>
    </item>
    <item>
      <title>Re: Decimal-date-time not working in web form</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/decimal-date-time-not-working-in-web-form/m-p/1243955#M46707</link>
      <description>&lt;P&gt;Hi Anthony,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am struggling with some thing very similar to your case. Have you menage to find a solution or a workaround? Did you get any feedback outside the esri community?&lt;/P&gt;&lt;P&gt;Thank you very much,&lt;/P&gt;&lt;P&gt;Dory&lt;/P&gt;</description>
      <pubDate>Wed, 28 Dec 2022 11:06:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/decimal-date-time-not-working-in-web-form/m-p/1243955#M46707</guid>
      <dc:creator>DoZ</dc:creator>
      <dc:date>2022-12-28T11:06:45Z</dc:date>
    </item>
    <item>
      <title>Re: Decimal-date-time not working in web form</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/decimal-date-time-not-working-in-web-form/m-p/1244820#M46757</link>
      <description>&lt;P&gt;Hi Dory,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately I never got a response on this and ended up removing the date element from my form. I can imagine there may be a way to convert the date in the javascript but I'm pretty much a novice with javascript so wouldn't know how. I suspect this issue may persist though when people are using the new pulldata from a feature service functionality as I'd assume any dates pulled into a json will also be in the UNIX epoch format although I haven't had chance to test it out yet.&lt;/P&gt;&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/2929"&gt;@IsmaelChivite&lt;/a&gt;&amp;nbsp;@Anonymous User, sorry for tagging you both again but I was wondering if the issue described above is a recognised bug or are we doing something wrong? Any help would be much appreciated.&lt;/P&gt;&lt;P&gt;Kind Regards&lt;/P&gt;&lt;P&gt;Anthony&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jan 2023 10:16:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/decimal-date-time-not-working-in-web-form/m-p/1244820#M46757</guid>
      <dc:creator>AnthonyJonesRSK</dc:creator>
      <dc:date>2023-01-03T10:16:22Z</dc:date>
    </item>
    <item>
      <title>Re: Decimal-date-time not working in web form</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/decimal-date-time-not-working-in-web-form/m-p/1253343#M47199</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/326067"&gt;@Anthony&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/542834"&gt;@DoZ&lt;/a&gt;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was able to get this to work by dividing the epoch timestamp by&amp;nbsp;&lt;SPAN&gt;86,400,000 (1000 * 60 * 60 * 24) and then using the date() function to convert to a date object. Let me know if that works for you!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;-Andrew&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jan 2023 15:21:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/decimal-date-time-not-working-in-web-form/m-p/1253343#M47199</guid>
      <dc:creator>AndrewO_support</dc:creator>
      <dc:date>2023-01-31T15:21:53Z</dc:date>
    </item>
    <item>
      <title>Re: Decimal-date-time not working in web form</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/decimal-date-time-not-working-in-web-form/m-p/1253379#M47202</link>
      <description>&lt;P&gt;Hi Andrew,&lt;/P&gt;&lt;P&gt;Thank you so much for your response, I've managed to replicate that with my form. Just wish I'd thought of that 10 months ago!&lt;/P&gt;&lt;P&gt;I'll be bookmarking this page so I can remind myself the next time I forget how to do it!&lt;/P&gt;&lt;P&gt;Thanks again,&lt;/P&gt;&lt;P&gt;Anthony&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jan 2023 15:57:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/decimal-date-time-not-working-in-web-form/m-p/1253379#M47202</guid>
      <dc:creator>AnthonyJonesRSK</dc:creator>
      <dc:date>2023-01-31T15:57:19Z</dc:date>
    </item>
    <item>
      <title>Re: Decimal-date-time not working in web form</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/decimal-date-time-not-working-in-web-form/m-p/1537913#M59123</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/513296"&gt;@AndrewO_support&lt;/a&gt;&amp;nbsp;I'm also struggling with the differences between the field app and web app.&lt;/P&gt;&lt;P&gt;I finally got my date calculation to work in the web app (where most of my users will be), but it is definitely handling something differently in the preview and field app. Makes testing... interesting!&lt;/P&gt;&lt;P&gt;I am pulling a birthday from another hosted feature layer in my survey - say May 15, 2022 at 12PM, or epoch time&amp;nbsp;1652630400000.&amp;nbsp; If I try converting it to date, I get "December 31 1969 at 12 PM" in the field app or the correct time, May 15 2022 at 12 PM in the web app.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Attached my example here. Anyone know how I can get the two platforms to agree this is May 15, 2022?&lt;/P&gt;</description>
      <pubDate>Thu, 12 Sep 2024 18:30:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/decimal-date-time-not-working-in-web-form/m-p/1537913#M59123</guid>
      <dc:creator>EricaNova</dc:creator>
      <dc:date>2024-09-12T18:30:05Z</dc:date>
    </item>
    <item>
      <title>Re: Decimal-date-time not working in web form</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/decimal-date-time-not-working-in-web-form/m-p/1538354#M59165</link>
      <description>&lt;P&gt;I had help from Alex at ESRI Canada and finally resolved this. I want users to enter an animal ID and then have the survey pull the animal's birthday from another hosted feature class.&lt;/P&gt;&lt;P&gt;I had to force field types for some fields (decimal and dateTime), then ensure the fields were hidden and readonly = yes (I am going to use the dates in a calculation rather than show them, and this ensures they appear properly in the S123 webapp editor).&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cell that pulls date from hosted feature class is type decimal, and calculation is:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;pulldata("@layer", "getValue", "attributes.animal_date_born", "replace_with_your_hosted_feature_layer_in_AGOL", concat('animal_id=', "'",${animal_id},"'"))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;calculation cell to convert to dateTime is type dateTime and contains:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;date-time(int(${animal_date_born}) div 86400000)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Screenshot:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="EricaNova_0-1726242946956.png" style="width: 855px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/115031i485ECC63875FF882/image-dimensions/855x76?v=v2" width="855" height="76" role="button" title="EricaNova_0-1726242946956.png" alt="EricaNova_0-1726242946956.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;example xlsx form is attached.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Sep 2024 15:59:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/decimal-date-time-not-working-in-web-form/m-p/1538354#M59165</guid>
      <dc:creator>EricaNova</dc:creator>
      <dc:date>2024-09-13T15:59:18Z</dc:date>
    </item>
    <item>
      <title>Re: Decimal-date-time not working in web form</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/decimal-date-time-not-working-in-web-form/m-p/1580182#M61021</link>
      <description>&lt;P&gt;Thank you - great post, was stuck for half a day until I found your setup.&amp;nbsp; Appreciate the screenshot and attachment.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jan 2025 21:26:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/decimal-date-time-not-working-in-web-form/m-p/1580182#M61021</guid>
      <dc:creator>MatthewPatterson2</dc:creator>
      <dc:date>2025-01-29T21:26:35Z</dc:date>
    </item>
  </channel>
</rss>

