<?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: Issue with Date Fields in ArcGIS Survey123 Questions</title>
    <link>https://community.esri.com/t5/arcgis-survey123-questions/issue-with-date-fields/m-p/1065294#M35078</link>
    <description>&lt;P&gt;Maybe you're using the wrong operator? This doc indicates that you are using too many equal signs.&amp;nbsp;&lt;A href="https://doc.arcgis.com/en/survey123/desktop/create-surveys/xlsformformulas.htm" target="_blank" rel="noopener"&gt;Formulas—ArcGIS Survey123 | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;In the past I have not had to define variables. I think you need to put the following in the calculation field in your xlsx table:&lt;/P&gt;&lt;P&gt;if({datein} == '' and {dateout} == '', "Register',&lt;/P&gt;&lt;P&gt;if({datein} != '' and {dateout} == '', 'Checked in',&lt;/P&gt;&lt;P&gt;if({datein} != '' and {dateout} 1= '', 'Checked out')))&lt;/P&gt;&lt;P&gt;You may want to consult this article for help on determining empty or null values, I'm not sure if my solution is 100% correct&amp;nbsp;&lt;A href="https://doc.arcgis.com/en/survey123/desktop/create-surveys/xlsformformulas.htm#ESRI_SECTION1_2954BF95CF674951AE9691A656CF157C" target="_blank" rel="noopener"&gt;Formulas—ArcGIS Survey123 | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;EDIT &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Sorry, didn't see that you're using JavaScript. I have not done that in Survey123.&lt;/P&gt;</description>
    <pubDate>Fri, 04 Jun 2021 20:28:10 GMT</pubDate>
    <dc:creator>SarahHartholt</dc:creator>
    <dc:date>2021-06-04T20:28:10Z</dc:date>
    <item>
      <title>Issue with Date Fields</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/issue-with-date-fields/m-p/1065279#M35074</link>
      <description>&lt;P&gt;hello Survey123 people.&lt;/P&gt;&lt;P&gt;I created a survey using Survey 123 Connect 3.12.232 to track Volunteer registration. I have a few fields for Check In and Check Out. When the Volunteer first register those 2 fields are blank (NULL) and later on they can comeback and check in or out. I added a basic JavaScript function (see below) to assign the "status' of the volunteer (Register, Checked In, Checked Out). As you can see on my images, everything seems to be working fine in design mode and mobile (IOS using Arcgis Survey 123) &lt;U&gt;&lt;STRONG&gt;BUT&lt;/STRONG&gt;&lt;/U&gt; when using the same survey online, the status value is always "Checked Out".&amp;nbsp; Is there a different way to handle DATE field ?&lt;/P&gt;&lt;P&gt;Any help would be much appreciated&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Dominic&lt;/P&gt;&lt;P&gt;***************************************************************&lt;/P&gt;&lt;P&gt;function drStatus(datein, dateout) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;if (datein === null &amp;amp;&amp;amp; dateout === null)&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return 'Register';&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; else if (datein !== null &amp;amp;&amp;amp; dateout === null)&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return 'Checked In';&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;else if (datein !== null &amp;amp;&amp;amp; dateout !== null)&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return 'Checked Out';&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;</description>
      <pubDate>Fri, 04 Jun 2021 19:22:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/issue-with-date-fields/m-p/1065279#M35074</guid>
      <dc:creator>DominicRobergeIADOT</dc:creator>
      <dc:date>2021-06-04T19:22:10Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with Date Fields</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/issue-with-date-fields/m-p/1065292#M35077</link>
      <description>&lt;P&gt;Just a guess but there may be an issue with null or empty string''.&amp;nbsp; maybe try&amp;nbsp; isEmpty()&amp;nbsp;&lt;A href="https://developers.arcgis.com/arcade/function-reference/logical_functions/#isempty" target="_blank"&gt;Logical Functions | ArcGIS for Developers&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Jun 2021 20:22:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/issue-with-date-fields/m-p/1065292#M35077</guid>
      <dc:creator>DavidPike</dc:creator>
      <dc:date>2021-06-04T20:22:52Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with Date Fields</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/issue-with-date-fields/m-p/1065294#M35078</link>
      <description>&lt;P&gt;Maybe you're using the wrong operator? This doc indicates that you are using too many equal signs.&amp;nbsp;&lt;A href="https://doc.arcgis.com/en/survey123/desktop/create-surveys/xlsformformulas.htm" target="_blank" rel="noopener"&gt;Formulas—ArcGIS Survey123 | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;In the past I have not had to define variables. I think you need to put the following in the calculation field in your xlsx table:&lt;/P&gt;&lt;P&gt;if({datein} == '' and {dateout} == '', "Register',&lt;/P&gt;&lt;P&gt;if({datein} != '' and {dateout} == '', 'Checked in',&lt;/P&gt;&lt;P&gt;if({datein} != '' and {dateout} 1= '', 'Checked out')))&lt;/P&gt;&lt;P&gt;You may want to consult this article for help on determining empty or null values, I'm not sure if my solution is 100% correct&amp;nbsp;&lt;A href="https://doc.arcgis.com/en/survey123/desktop/create-surveys/xlsformformulas.htm#ESRI_SECTION1_2954BF95CF674951AE9691A656CF157C" target="_blank" rel="noopener"&gt;Formulas—ArcGIS Survey123 | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;EDIT &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Sorry, didn't see that you're using JavaScript. I have not done that in Survey123.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Jun 2021 20:28:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/issue-with-date-fields/m-p/1065294#M35078</guid>
      <dc:creator>SarahHartholt</dc:creator>
      <dc:date>2021-06-04T20:28:10Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with Date Fields</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/issue-with-date-fields/m-p/1065305#M35080</link>
      <description>&lt;P&gt;ok, thank you guys for your help.. I modified the function as follow and everything is working as expected.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;function drStatus(datein, dateout) {&lt;/P&gt;&lt;P&gt;if (!datein &amp;amp;&amp;amp; !dateout)&lt;/P&gt;&lt;P&gt;return 'Register';&lt;/P&gt;&lt;P&gt;else if (datein != null &amp;amp;&amp;amp; !dateout)&lt;/P&gt;&lt;P&gt;return 'Checked In';&lt;/P&gt;&lt;P&gt;else if (datein != null &amp;amp;&amp;amp; dateout != null)&lt;/P&gt;&lt;P&gt;return 'Checked Out';&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Jun 2021 21:01:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/issue-with-date-fields/m-p/1065305#M35080</guid>
      <dc:creator>BenMcConville</dc:creator>
      <dc:date>2021-06-04T21:01:26Z</dc:date>
    </item>
  </channel>
</rss>

