<?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: Type mismatch with pulldata() extracting dates from other feature service in ArcGIS Survey123 Questions</title>
    <link>https://community.esri.com/t5/arcgis-survey123-questions/type-mismatch-with-pulldata-extracting-dates-from/m-p/1209646#M44651</link>
    <description>&lt;P&gt;Sorry for the auto-reply, I'm not sure who to tag other then you&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/2929"&gt;@IsmaelChivite&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/1213"&gt;@JamesTedrick&lt;/a&gt;&amp;nbsp;for help&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 05 Sep 2022 09:42:48 GMT</pubDate>
    <dc:creator>LucaTD</dc:creator>
    <dc:date>2022-09-05T09:42:48Z</dc:date>
    <item>
      <title>Type mismatch with pulldata() extracting dates from other feature service</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/type-mismatch-with-pulldata-extracting-dates-from/m-p/1171389#M42612</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;I'm running into a problem on a survey when I'm trying to extract date values from another feature service.&lt;/P&gt;&lt;P&gt;The survey required to set up a javascript function to collect data from another feature service and recover the information of some students. Then, in the survey we recover the personal info of these students, among which we have birth dates.&lt;/P&gt;&lt;P&gt;These fields have to be notes and every pull works fine but for the dates. When I extract a date to note it transforms it in epoch format. Usually not an issue, as I would use &lt;STRONG&gt;&lt;EM&gt;format-date()&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;to make it readable.&lt;/P&gt;&lt;P&gt;However, whenever I try to use format-date, Connect will return a type mismatch error. Same when using decimal-date-time or date functions.&lt;/P&gt;&lt;P&gt;My first workaround was to keep the &lt;EM&gt;birth-date &lt;/EM&gt;type question as "date" and "read-only". That works for the field and desktop apps but not for the web browser app. Unfortunately, I need this to work on browser as well.&lt;/P&gt;&lt;P&gt;I double-checked that the field type of the pulled date is "date" and I confirm it's "date" and not "string".&lt;/P&gt;&lt;P&gt;I'm attaching a snippet of the survey and the function (minus the url of the pulled service)&lt;/P&gt;&lt;P&gt;I'm out of ideas and wondering if this is a bug or a known issue. I tag the great survey masters&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/1213"&gt;@JamesTedrick&lt;/a&gt; and&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/2929"&gt;@IsmaelChivite&lt;/a&gt; for support, but anyone help would be extremely appreciated.&lt;/P&gt;&lt;P&gt;Luca&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 May 2022 08:22:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/type-mismatch-with-pulldata-extracting-dates-from/m-p/1171389#M42612</guid>
      <dc:creator>LucaTD</dc:creator>
      <dc:date>2022-05-06T08:22:52Z</dc:date>
    </item>
    <item>
      <title>Re: Type mismatch with pulldata() extracting dates from other feature service</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/type-mismatch-with-pulldata-extracting-dates-from/m-p/1209646#M44651</link>
      <description>&lt;P&gt;Sorry for the auto-reply, I'm not sure who to tag other then you&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/2929"&gt;@IsmaelChivite&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/1213"&gt;@JamesTedrick&lt;/a&gt;&amp;nbsp;for help&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Sep 2022 09:42:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/type-mismatch-with-pulldata-extracting-dates-from/m-p/1209646#M44651</guid>
      <dc:creator>LucaTD</dc:creator>
      <dc:date>2022-09-05T09:42:48Z</dc:date>
    </item>
    <item>
      <title>Re: Type mismatch with pulldata() extracting dates from other feature service</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/type-mismatch-with-pulldata-extracting-dates-from/m-p/1272067#M48195</link>
      <description>&lt;P&gt;I was having the same issue on my form. I am working with a consultant - John Lucotch at Equinox Geospatial - and he figured out the following code that works properly:&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="50%" height="24px"&gt;&lt;FONT color="#000000"&gt;&lt;STRONG&gt;name&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/TD&gt;&lt;TD width="50%" height="24px"&gt;&lt;FONT color="#000000"&gt;&lt;STRONG&gt;calculation&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%" height="46px"&gt;pulldata_json_return&lt;/TD&gt;&lt;TD width="50%" height="46px"&gt;pulldata("@layer", "getRecord", "&lt;STRONG&gt;feature service url&lt;/STRONG&gt;", "&lt;STRONG&gt;WHERE clause&lt;/STRONG&gt;")&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%" height="24px"&gt;date_text&lt;/TD&gt;&lt;TD width="50%" height="24px"&gt;format-date(int(pulldata("@json",${pulldata_json_return},"attributes.&lt;STRONG&gt;field_name&lt;/STRONG&gt;")),'%Y.%m.%d')&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;field_name&lt;/STRONG&gt; is the name of the field containing the date you wish to return from the feature layer you are querying&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;John, my consultant, believes that&amp;nbsp;&lt;SPAN&gt;&lt;SPAN class=""&gt;the json where property is returning the date as a string.&amp;nbsp; Converting the string to an integer allows the epoch time to run properly in your code.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Mar 2023 18:23:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/type-mismatch-with-pulldata-extracting-dates-from/m-p/1272067#M48195</guid>
      <dc:creator>AlexSteiner</dc:creator>
      <dc:date>2023-03-27T18:23:54Z</dc:date>
    </item>
    <item>
      <title>Re: Type mismatch with pulldata() extracting dates from other feature service</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/type-mismatch-with-pulldata-extracting-dates-from/m-p/1394745#M55430</link>
      <description>&lt;P&gt;I know this is an old post but just wanted to say thanks for this Alex (and your consultant John!) as I was losing my mind trying to format the date from a feature service using pulldata. Hadn't even crossed my mind that the number was coming through as a string as it doesn't appear in the json with quotation marks so just assumed it was already a number. Cheers&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2024 16:16:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/type-mismatch-with-pulldata-extracting-dates-from/m-p/1394745#M55430</guid>
      <dc:creator>AnthonyJonesRSK</dc:creator>
      <dc:date>2024-03-12T16:16:07Z</dc:date>
    </item>
  </channel>
</rss>

