<?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: Restrict Date Entry Based on Previous Question in ArcGIS Survey123 Questions</title>
    <link>https://community.esri.com/t5/arcgis-survey123-questions/restrict-date-entry-based-on-previous-question/m-p/1229606#M45927</link>
    <description>&lt;P&gt;Ugh forgive me that oversight. Still getting the same problem in the form though.&lt;/P&gt;</description>
    <pubDate>Tue, 08 Nov 2022 17:39:16 GMT</pubDate>
    <dc:creator>ZachBodenner</dc:creator>
    <dc:date>2022-11-08T17:39:16Z</dc:date>
    <item>
      <title>Restrict Date Entry Based on Previous Question</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/restrict-date-entry-based-on-previous-question/m-p/1229548#M45920</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am trying to restrict a date range based on a previously entered date. Here's the goal:&lt;/P&gt;&lt;P&gt;Question 1: Enter a date at least seven days from today.&lt;/P&gt;&lt;P&gt;Question 2: Enter a date less than two months (62 days) from the date entered in Q1.&lt;/P&gt;&lt;P&gt;The setup: Survey123 Connect, survey published to Enterprise Portal 10.8.1&lt;/P&gt;&lt;P&gt;Constraints:&lt;/P&gt;&lt;P&gt;Q1:&amp;nbsp;.&amp;gt;date(decimal-date-time(now()) + 7)&lt;/P&gt;&lt;P&gt;Q2:&amp;nbsp;(.&amp;gt;=${Q1}) and (.&amp;lt;=(${Q1} + (1000 * 60 * 60 * 24 * 62)))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When published, Q1 works fine, but no date entered into Q2 is accepted by the form (no errors when saving .xls form or publishing).&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2022 15:58:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/restrict-date-entry-based-on-previous-question/m-p/1229548#M45920</guid>
      <dc:creator>ZachBodenner</dc:creator>
      <dc:date>2022-11-08T15:58:19Z</dc:date>
    </item>
    <item>
      <title>Re: Restrict Date Entry Based on Previous Question</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/restrict-date-entry-based-on-previous-question/m-p/1229584#M45923</link>
      <description>&lt;P&gt;Try changing all your . to ${Q2}&amp;nbsp; sometimes .&amp;lt;= or others gets confused with HTML and causes issues.&amp;nbsp; Esp in the web form.&amp;nbsp; Being specific vs just the . can help.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2022 17:02:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/restrict-date-entry-based-on-previous-question/m-p/1229584#M45923</guid>
      <dc:creator>DougBrowning</dc:creator>
      <dc:date>2022-11-08T17:02:07Z</dc:date>
    </item>
    <item>
      <title>Re: Restrict Date Entry Based on Previous Question</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/restrict-date-entry-based-on-previous-question/m-p/1229591#M45925</link>
      <description>&lt;P&gt;So&amp;nbsp;({Q2}&amp;gt;=${Q1}) and ({Q2}&amp;lt;=(${Q1} + (1000 * 60 * 60 * 24 * 62))) ?&lt;/P&gt;&lt;P&gt;That gives me an error converting XLSForm&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ZachBodenner_0-1667927465159.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/55489iBD05C2C8DAE73FFE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ZachBodenner_0-1667927465159.png" alt="ZachBodenner_0-1667927465159.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="ZachBodenner_1-1667927489104.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/55490i8EB6DD95A86FB4E8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ZachBodenner_1-1667927489104.png" alt="ZachBodenner_1-1667927489104.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="ZachBodenner_2-1667927501969.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/55491iFC7D986AA0506B31/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ZachBodenner_2-1667927501969.png" alt="ZachBodenner_2-1667927501969.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2022 17:11:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/restrict-date-entry-based-on-previous-question/m-p/1229591#M45925</guid>
      <dc:creator>ZachBodenner</dc:creator>
      <dc:date>2022-11-08T17:11:49Z</dc:date>
    </item>
    <item>
      <title>Re: Restrict Date Entry Based on Previous Question</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/restrict-date-entry-based-on-previous-question/m-p/1229605#M45926</link>
      <description>&lt;P&gt;you forgot the $&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2022 17:34:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/restrict-date-entry-based-on-previous-question/m-p/1229605#M45926</guid>
      <dc:creator>DougBrowning</dc:creator>
      <dc:date>2022-11-08T17:34:36Z</dc:date>
    </item>
    <item>
      <title>Re: Restrict Date Entry Based on Previous Question</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/restrict-date-entry-based-on-previous-question/m-p/1229606#M45927</link>
      <description>&lt;P&gt;Ugh forgive me that oversight. Still getting the same problem in the form though.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2022 17:39:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/restrict-date-entry-based-on-previous-question/m-p/1229606#M45927</guid>
      <dc:creator>ZachBodenner</dc:creator>
      <dc:date>2022-11-08T17:39:16Z</dc:date>
    </item>
    <item>
      <title>Re: Restrict Date Entry Based on Previous Question</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/restrict-date-entry-based-on-previous-question/m-p/1229630#M45929</link>
      <description>&lt;P&gt;So is it just not getting stopped for blank for Q2?&amp;nbsp; you can make Q2 required or add to the constraint ${Q2} != ''&lt;/P&gt;&lt;P&gt;I think the calc is not firing when the field in blank.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2022 18:33:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/restrict-date-entry-based-on-previous-question/m-p/1229630#M45929</guid>
      <dc:creator>DougBrowning</dc:creator>
      <dc:date>2022-11-08T18:33:26Z</dc:date>
    </item>
    <item>
      <title>Re: Restrict Date Entry Based on Previous Question</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/restrict-date-entry-based-on-previous-question/m-p/1229645#M45930</link>
      <description>&lt;P&gt;Hm, so it is a required question. I also tried setting a default entry of today() thinking maybe you're right with the last comment there but that didn't do anything either. Where in the constraint would I add&amp;nbsp;&lt;SPAN&gt;${Q2} != ''? Would that have much a different function than setting a default entry?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Additionally, I tried using this constraint:&amp;nbsp;&lt;SPAN&gt;(.&amp;gt;= today()) and (.&amp;lt;=(today() + (1000 * 60 * 60 * 24 * 14))), since &lt;A href="https://doc.arcgis.com/en/survey123/desktop/create-surveys/xlsformformulas.htm" target="_self"&gt;ESRI documentation&lt;/A&gt;&amp;nbsp;spells it out specifically. That actually gives the same problem in the form (again, no error when updating the xls form). No date is accepted.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2022 19:21:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/restrict-date-entry-based-on-previous-question/m-p/1229645#M45930</guid>
      <dc:creator>ZachBodenner</dc:creator>
      <dc:date>2022-11-08T19:21:02Z</dc:date>
    </item>
    <item>
      <title>Re: Restrict Date Entry Based on Previous Question</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/restrict-date-entry-based-on-previous-question/m-p/1229659#M45932</link>
      <description>&lt;P&gt;Are you trying to constrain from today until 14 days from now?&amp;nbsp; That is what is looks like. If so this works for me&lt;/P&gt;&lt;P&gt;${testdate} &amp;gt;= now() and ${testdate} &amp;lt;= date(decimal-date-time(now()) + &amp;nbsp;14)&lt;/P&gt;&lt;P&gt;Hope that does it&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2022 20:01:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/restrict-date-entry-based-on-previous-question/m-p/1229659#M45932</guid>
      <dc:creator>DougBrowning</dc:creator>
      <dc:date>2022-11-08T20:01:55Z</dc:date>
    </item>
    <item>
      <title>Re: Restrict Date Entry Based on Previous Question</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/restrict-date-entry-based-on-previous-question/m-p/1229662#M45933</link>
      <description>&lt;P&gt;No, I was just trying to see if I could get anything to work in the constraint for Q2.&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, your example actually works, which is interesting. I wonder why it needs to be decimal time? So ultimately my successful constraint is:&lt;/P&gt;&lt;P&gt;${Q2} &amp;gt;= ${Q1} and ${Q2} &amp;lt;= date(decimal-date-time(${Q1}) + 62)&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2022 20:07:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/restrict-date-entry-based-on-previous-question/m-p/1229662#M45933</guid>
      <dc:creator>ZachBodenner</dc:creator>
      <dc:date>2022-11-08T20:07:38Z</dc:date>
    </item>
    <item>
      <title>Re: Restrict Date Entry Based on Previous Question</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/restrict-date-entry-based-on-previous-question/m-p/1229663#M45934</link>
      <description>&lt;P&gt;Dates are a different data type so you cannot just do math on them.&amp;nbsp; Just like a string - 2 makes no sense.&amp;nbsp; I will admit I do not know the exacts here either I always open up the form I got it to work in and copy paste :).&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2022 20:11:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/restrict-date-entry-based-on-previous-question/m-p/1229663#M45934</guid>
      <dc:creator>DougBrowning</dc:creator>
      <dc:date>2022-11-08T20:11:48Z</dc:date>
    </item>
    <item>
      <title>Re: Restrict Date Entry Based on Previous Question</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/restrict-date-entry-based-on-previous-question/m-p/1684415#M65423</link>
      <description>&lt;P&gt;For anyone hitting their head against the wall.. this doesn't always show up in the preview in S123.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Feb 2026 20:09:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/restrict-date-entry-based-on-previous-question/m-p/1684415#M65423</guid>
      <dc:creator>EricaNova</dc:creator>
      <dc:date>2026-02-13T20:09:25Z</dc:date>
    </item>
  </channel>
</rss>

