<?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: Answer auto-selected based on date in ArcGIS Survey123 Questions</title>
    <link>https://community.esri.com/t5/arcgis-survey123-questions/answer-auto-selected-based-on-date/m-p/805713#M11984</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jason,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes this is possible, but would be a little complex and also needs a little more information in for the quarterly/semi-annual criteria (which month should the inspection be in of the quarter).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To&amp;nbsp;model this out, let's assume the quarterly inspections occur on the 1st month of quarter based on the calendar year (i.e., January, April, July, October), semi-annual in July&amp;nbsp;and the annual in January, all on the first Friday of the month&lt;/P&gt;&lt;TABLE class="j-table jiveBorder" style="border: 1px solid #c6c6c6;" width="100%"&gt;&lt;THEAD&gt;&lt;TR style="background-color: #efefef; height: 25px;"&gt;&lt;TH style="width: 37.7892030848329%; height: 25px;"&gt;Day&lt;/TH&gt;&lt;TH style="width: 59.25449871465296%; height: 25px;"&gt;Form Type&lt;/TH&gt;&lt;/TR&gt;&lt;/THEAD&gt;&lt;TBODY&gt;&lt;TR style="height: 25px;"&gt;&lt;TD style="width: 37.7892030848329%; height: 25px;"&gt;Saturday - Thursday (i.e., not Friday)&lt;/TD&gt;&lt;TD style="width: 59.25449871465296%; height: 25px;"&gt;Daily&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 25px;"&gt;&lt;TD style="width: 37.7892030848329%; height: 25px;"&gt;Friday (not 1st Friday -&amp;gt; day &amp;gt; 7)&lt;/TD&gt;&lt;TD style="width: 59.25449871465296%; height: 25px;"&gt;Weekly&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 25px;"&gt;&lt;TD style="width: 37.7892030848329%; height: 25px;"&gt;Friday (1st Friday -&amp;gt; day &amp;lt;=7)&lt;/TD&gt;&lt;TD style="width: 59.25449871465296%; height: 25px;"&gt;Monthly&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 25px;"&gt;&lt;TD style="width: 37.7892030848329%; height: 25px;"&gt;Friday (1st Friday of -&amp;gt; day &amp;lt;=7, 1 month of the quarter)&lt;/TD&gt;&lt;TD style="width: 59.25449871465296%; height: 25px;"&gt;Quarterly&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 25px;"&gt;&lt;TD style="width: 37.7892030848329%; height: 25px;"&gt;Friday (1st Friday of -&amp;gt; day &amp;lt;=7, month of June)&lt;/TD&gt;&lt;TD style="width: 59.25449871465296%; height: 25px;"&gt;Semi-annual&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 25px;"&gt;&lt;TD style="width: 37.7892030848329%; height: 25px;"&gt;Friday (1st Friday of -&amp;gt; day &amp;lt;=7, month of January)&lt;/TD&gt;&lt;TD style="width: 59.25449871465296%; height: 25px;"&gt;Annual&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you might guess from the multiple criteria, multiple (nested) if() statements will be needed. &amp;nbsp;The day of the week can be determined from format-date(${dateQ},'%a'), which gives the 3 letter abbreviation of the day:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(&amp;nbsp;&lt;SPAN&gt;format-date(${dateQ},'%a') != 'Fri', 'daily', ...)&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Adding in the weekly is comparison of the weekday (which can be retrieved by int(format-date(${dateQ},'%e')):&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;if(&amp;nbsp;&lt;SPAN&gt;format-date(${dateQ},'%a') != 'Fri', 'daily', if(int(&lt;SPAN&gt;format-date(${dateQ},'%e')) &amp;gt; 7, 'weekly', ...&amp;nbsp;&lt;/SPAN&gt;))&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;The&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;separation between Monthly, Quarterly, Semi-annual and annual look at the month value int(format-date(${dateQ}, '%n')):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;if(&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;format-date(${dateQ},'%a') != 'Fri', 'daily', if(int(&lt;SPAN&gt;format-date(${dateQ},'%e')) &amp;gt; 7, 'weekly', if(int(format-date(${dateQ}, '%n')) = 1, 'annual', if(int(format-date(${dateQ}, '%n')) =&amp;nbsp;7, 'semiannual', if(int(format-date(${dateQ}, '%n')) = 4 or int(format-date(${dateQ}, '%n')) = 10, 'quarterly', 'monthly')))&lt;/SPAN&gt;))&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 24 Oct 2019 21:55:49 GMT</pubDate>
    <dc:creator>JamesTedrick</dc:creator>
    <dc:date>2019-10-24T21:55:49Z</dc:date>
    <item>
      <title>Answer auto-selected based on date</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/answer-auto-selected-based-on-date/m-p/805712#M11983</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a daily, weekly, monthly, quarterly, bi-annual, and annual inspection that is performed on an asset.&amp;nbsp; I'd like the default inspection type to be daily but then be defaulted to weekly every Friday, monthly on the first Friday of every month&amp;nbsp;the month, quarterly every third month, etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way to do this through some sort of 'if' statement in Survey123?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Oct 2019 12:50:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/answer-auto-selected-based-on-date/m-p/805712#M11983</guid>
      <dc:creator>JasonCyphers</dc:creator>
      <dc:date>2019-10-23T12:50:45Z</dc:date>
    </item>
    <item>
      <title>Re: Answer auto-selected based on date</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/answer-auto-selected-based-on-date/m-p/805713#M11984</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jason,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes this is possible, but would be a little complex and also needs a little more information in for the quarterly/semi-annual criteria (which month should the inspection be in of the quarter).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To&amp;nbsp;model this out, let's assume the quarterly inspections occur on the 1st month of quarter based on the calendar year (i.e., January, April, July, October), semi-annual in July&amp;nbsp;and the annual in January, all on the first Friday of the month&lt;/P&gt;&lt;TABLE class="j-table jiveBorder" style="border: 1px solid #c6c6c6;" width="100%"&gt;&lt;THEAD&gt;&lt;TR style="background-color: #efefef; height: 25px;"&gt;&lt;TH style="width: 37.7892030848329%; height: 25px;"&gt;Day&lt;/TH&gt;&lt;TH style="width: 59.25449871465296%; height: 25px;"&gt;Form Type&lt;/TH&gt;&lt;/TR&gt;&lt;/THEAD&gt;&lt;TBODY&gt;&lt;TR style="height: 25px;"&gt;&lt;TD style="width: 37.7892030848329%; height: 25px;"&gt;Saturday - Thursday (i.e., not Friday)&lt;/TD&gt;&lt;TD style="width: 59.25449871465296%; height: 25px;"&gt;Daily&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 25px;"&gt;&lt;TD style="width: 37.7892030848329%; height: 25px;"&gt;Friday (not 1st Friday -&amp;gt; day &amp;gt; 7)&lt;/TD&gt;&lt;TD style="width: 59.25449871465296%; height: 25px;"&gt;Weekly&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 25px;"&gt;&lt;TD style="width: 37.7892030848329%; height: 25px;"&gt;Friday (1st Friday -&amp;gt; day &amp;lt;=7)&lt;/TD&gt;&lt;TD style="width: 59.25449871465296%; height: 25px;"&gt;Monthly&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 25px;"&gt;&lt;TD style="width: 37.7892030848329%; height: 25px;"&gt;Friday (1st Friday of -&amp;gt; day &amp;lt;=7, 1 month of the quarter)&lt;/TD&gt;&lt;TD style="width: 59.25449871465296%; height: 25px;"&gt;Quarterly&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 25px;"&gt;&lt;TD style="width: 37.7892030848329%; height: 25px;"&gt;Friday (1st Friday of -&amp;gt; day &amp;lt;=7, month of June)&lt;/TD&gt;&lt;TD style="width: 59.25449871465296%; height: 25px;"&gt;Semi-annual&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 25px;"&gt;&lt;TD style="width: 37.7892030848329%; height: 25px;"&gt;Friday (1st Friday of -&amp;gt; day &amp;lt;=7, month of January)&lt;/TD&gt;&lt;TD style="width: 59.25449871465296%; height: 25px;"&gt;Annual&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you might guess from the multiple criteria, multiple (nested) if() statements will be needed. &amp;nbsp;The day of the week can be determined from format-date(${dateQ},'%a'), which gives the 3 letter abbreviation of the day:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(&amp;nbsp;&lt;SPAN&gt;format-date(${dateQ},'%a') != 'Fri', 'daily', ...)&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Adding in the weekly is comparison of the weekday (which can be retrieved by int(format-date(${dateQ},'%e')):&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;if(&amp;nbsp;&lt;SPAN&gt;format-date(${dateQ},'%a') != 'Fri', 'daily', if(int(&lt;SPAN&gt;format-date(${dateQ},'%e')) &amp;gt; 7, 'weekly', ...&amp;nbsp;&lt;/SPAN&gt;))&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;The&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;separation between Monthly, Quarterly, Semi-annual and annual look at the month value int(format-date(${dateQ}, '%n')):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;if(&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;format-date(${dateQ},'%a') != 'Fri', 'daily', if(int(&lt;SPAN&gt;format-date(${dateQ},'%e')) &amp;gt; 7, 'weekly', if(int(format-date(${dateQ}, '%n')) = 1, 'annual', if(int(format-date(${dateQ}, '%n')) =&amp;nbsp;7, 'semiannual', if(int(format-date(${dateQ}, '%n')) = 4 or int(format-date(${dateQ}, '%n')) = 10, 'quarterly', 'monthly')))&lt;/SPAN&gt;))&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Oct 2019 21:55:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/answer-auto-selected-based-on-date/m-p/805713#M11984</guid>
      <dc:creator>JamesTedrick</dc:creator>
      <dc:date>2019-10-24T21:55:49Z</dc:date>
    </item>
    <item>
      <title>Re: Answer auto-selected based on date</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/answer-auto-selected-based-on-date/m-p/805714#M11985</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you so much James.&amp;nbsp; This is perfect!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Oct 2019 09:46:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/answer-auto-selected-based-on-date/m-p/805714#M11985</guid>
      <dc:creator>JasonCyphers</dc:creator>
      <dc:date>2019-10-25T09:46:36Z</dc:date>
    </item>
  </channel>
</rss>

