<?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: Populate String or Date Field using Date and Time questions in ArcGIS Survey123 Questions</title>
    <link>https://community.esri.com/t5/arcgis-survey123-questions/populate-string-or-date-field-using-date-and-time/m-p/1273507#M48318</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/251557"&gt;@ZacharySutherby&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Thank you for the reply! I found the issue was likely due to missing curly brackets around my field name. The concat did work- thanks.&lt;/P&gt;&lt;P&gt;This was my final calculation formula:&lt;/P&gt;&lt;P&gt;if(string-length(${ShiftStartTime})!=0, concat(string(format-date(${ShiftStartDate}, "%m/%d/%Y")), " ", string(format-date(${ShiftStartTime}, "%H:%M"))), "")&lt;/P&gt;</description>
    <pubDate>Thu, 30 Mar 2023 14:02:02 GMT</pubDate>
    <dc:creator>JBeasley</dc:creator>
    <dc:date>2023-03-30T14:02:02Z</dc:date>
    <item>
      <title>Populate String or Date Field using Date and Time questions</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/populate-string-or-date-field-using-date-and-time/m-p/1273328#M48304</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;We have a survey with a shift start and stop time. We need the user to enter specific times so we are using a Date type question and a separate Time type question to avoid the auto population of the time that occurs in a DateTime type question.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it possible to then combine the Date and Time results and combine those in a single field? I have tried a few configurations and calculations, but frequently receive a type mismatch error. I'd essentially like to replace the "default" time that gets applied to a date/dateTime field with the user input...&lt;/P&gt;&lt;P&gt;Here is how I envision the date and time question configuration:&lt;/P&gt;&lt;TABLE border="1" width="100.0000029254514%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="3.9215686274509807%" height="29px"&gt;&lt;STRONG&gt;type&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="4.134697357203748%" height="29px"&gt;&lt;STRONG&gt;name&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="58.61040068201194%" height="29px"&gt;&lt;STRONG&gt;bind::esri:fieldType&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="3.9215686274509807%" height="24px"&gt;date&lt;/TD&gt;&lt;TD width="4.134697357203748%" height="24px"&gt;ShiftStartDate&lt;/TD&gt;&lt;TD width="58.61040068201194%" height="24px"&gt;null&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="3.9215686274509807%" height="10px"&gt;time&lt;/TD&gt;&lt;TD width="4.134697357203748%" height="10px"&gt;ShiftStartTime&lt;/TD&gt;&lt;TD width="58.61040068201194%" height="10px"&gt;null&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is a calculation I have tried for reference of what I am trying to achieve:&lt;/P&gt;&lt;TABLE border="1" width="779px"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="87.1625px" height="24px"&gt;&lt;STRONG&gt;type&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="125.238px" height="24px"&gt;&lt;STRONG&gt;name&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="411.8px" height="24px"&gt;&lt;STRONG&gt;calculation&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="154px" height="24px"&gt;&lt;STRONG&gt;bind::esri:fieldType&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="87.1625px" height="65px"&gt;text&lt;/TD&gt;&lt;TD width="125.238px" height="65px"&gt;ShiftStart&lt;/TD&gt;&lt;TD width="411.8px" height="65px"&gt;string(format-date($ShiftStartDate, "%m/%d/%Y")) + " " + string(format-date($ShiftStartTime, "%h:%M"))&lt;/TD&gt;&lt;TD width="154px" height="65px"&gt;esriFieldTypeString&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am open to the ShiftStart field being date or string type in the service. Thank you!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Mar 2023 22:49:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/populate-string-or-date-field-using-date-and-time/m-p/1273328#M48304</guid>
      <dc:creator>JBeasley</dc:creator>
      <dc:date>2023-03-29T22:49:08Z</dc:date>
    </item>
    <item>
      <title>Re: Populate String or Date Field using Date and Time questions</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/populate-string-or-date-field-using-date-and-time/m-p/1273365#M48308</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/644709"&gt;@JBeasley&lt;/a&gt;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;You will need to use the &lt;A href="https://doc.arcgis.com/en/survey123/desktop/create-surveys/xlsformformulas.htm#GUID-EDC5F715-F200-4281-B831-C817329A6C3B" target="_self"&gt;concat()&lt;/A&gt; function to merge the strings together as opposed to the plus sign. With the plus sign Survey123 is trying to perform a mathematical addition with the values. The calculation would look like:&amp;nbsp;&lt;/P&gt;&lt;P&gt;concat(&lt;SPAN&gt;string(format-date($ShiftStartDate, "%m/%d/%Y")), " ", string(format-date($ShiftStartTime, "%h:%M")))&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2023 00:38:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/populate-string-or-date-field-using-date-and-time/m-p/1273365#M48308</guid>
      <dc:creator>ZacharySutherby</dc:creator>
      <dc:date>2023-03-30T00:38:32Z</dc:date>
    </item>
    <item>
      <title>Re: Populate String or Date Field using Date and Time questions</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/populate-string-or-date-field-using-date-and-time/m-p/1273507#M48318</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/251557"&gt;@ZacharySutherby&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Thank you for the reply! I found the issue was likely due to missing curly brackets around my field name. The concat did work- thanks.&lt;/P&gt;&lt;P&gt;This was my final calculation formula:&lt;/P&gt;&lt;P&gt;if(string-length(${ShiftStartTime})!=0, concat(string(format-date(${ShiftStartDate}, "%m/%d/%Y")), " ", string(format-date(${ShiftStartTime}, "%H:%M"))), "")&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2023 14:02:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/populate-string-or-date-field-using-date-and-time/m-p/1273507#M48318</guid>
      <dc:creator>JBeasley</dc:creator>
      <dc:date>2023-03-30T14:02:02Z</dc:date>
    </item>
  </channel>
</rss>

