<?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 Use yesterday's date in form, dependency error in ArcGIS Survey123 Questions</title>
    <link>https://community.esri.com/t5/arcgis-survey123-questions/use-yesterday-s-date-in-form-dependency-error/m-p/1400267#M55706</link>
    <description>&lt;P&gt;I'm trying to auto-populate a field using yesterday's date. I'm conducting a survey where we check a product twice. Once on a date and then the next day we recheck the product for differences. I have a select_one (${date_choice}) with two options, wakeup and holdover, and two date fields, a wakeup date (the first date) and a holdover date (next day).&lt;/P&gt;&lt;P&gt;I'm trying to auto-populate the wakeup date field, ${date_wake}, so that it populates today or yesterday based on the datechoice chosen. I can't find an easy option for yesterday, but I got to the expression below. I ran into a dependency cycle error and don't know what else to try. Can anyone help?&lt;/P&gt;&lt;P&gt;if(selected(${date_choice}, 'wakeup'), today(), if(selected(${date_choice}, 'holdover'), ${date_wake}&amp;lt;today(), 0))&lt;/P&gt;</description>
    <pubDate>Mon, 25 Mar 2024 10:45:59 GMT</pubDate>
    <dc:creator>JamieShinskie</dc:creator>
    <dc:date>2024-03-25T10:45:59Z</dc:date>
    <item>
      <title>Use yesterday's date in form, dependency error</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/use-yesterday-s-date-in-form-dependency-error/m-p/1400267#M55706</link>
      <description>&lt;P&gt;I'm trying to auto-populate a field using yesterday's date. I'm conducting a survey where we check a product twice. Once on a date and then the next day we recheck the product for differences. I have a select_one (${date_choice}) with two options, wakeup and holdover, and two date fields, a wakeup date (the first date) and a holdover date (next day).&lt;/P&gt;&lt;P&gt;I'm trying to auto-populate the wakeup date field, ${date_wake}, so that it populates today or yesterday based on the datechoice chosen. I can't find an easy option for yesterday, but I got to the expression below. I ran into a dependency cycle error and don't know what else to try. Can anyone help?&lt;/P&gt;&lt;P&gt;if(selected(${date_choice}, 'wakeup'), today(), if(selected(${date_choice}, 'holdover'), ${date_wake}&amp;lt;today(), 0))&lt;/P&gt;</description>
      <pubDate>Mon, 25 Mar 2024 10:45:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/use-yesterday-s-date-in-form-dependency-error/m-p/1400267#M55706</guid>
      <dc:creator>JamieShinskie</dc:creator>
      <dc:date>2024-03-25T10:45:59Z</dc:date>
    </item>
    <item>
      <title>Re: Use yesterday's date in form, dependency error</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/use-yesterday-s-date-in-form-dependency-error/m-p/1400273#M55707</link>
      <description>&lt;OL&gt;&lt;LI&gt;date_choice = wakeup or holdover&lt;/LI&gt;&lt;LI&gt;date_wakeup =&amp;nbsp; &lt;SPAN&gt;if(selected(${date_choice}, 'wakeup'), today(), if(selected(${date_choice}, 'holdover'), &lt;STRONG&gt;${date_wake}&amp;lt;today()&lt;/STRONG&gt;, 0))&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;SPAN&gt;I assume date_wake in the function is date_wakeup and is referring to the own question? Shouldn't this be the alternate answer for holdover, i.e. today() - 1 day?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;You've put in a constraint formula where you want something more like int(today()) -(1000*24*60*60)&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Mar 2024 11:23:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/use-yesterday-s-date-in-form-dependency-error/m-p/1400273#M55707</guid>
      <dc:creator>ChristopherCounsell</dc:creator>
      <dc:date>2024-03-25T11:23:09Z</dc:date>
    </item>
    <item>
      <title>Re: Use yesterday's date in form, dependency error</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/use-yesterday-s-date-in-form-dependency-error/m-p/1400331#M55712</link>
      <description>&lt;P&gt;I'm trying to teach myself this coding on the fly, and I don't understand what you mean. I tried using today() - 1 day in place of the bolded text and that did not work and I also tried to place the formula&amp;nbsp;&lt;SPAN&gt;int(today()) -(1000*24*60*60) in the constraint column and that did not work.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Mar 2024 14:00:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/use-yesterday-s-date-in-form-dependency-error/m-p/1400331#M55712</guid>
      <dc:creator>JamieShinskie</dc:creator>
      <dc:date>2024-03-25T14:00:03Z</dc:date>
    </item>
    <item>
      <title>Re: Use yesterday's date in form, dependency error</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/use-yesterday-s-date-in-form-dependency-error/m-p/1400354#M55718</link>
      <description>&lt;P&gt;Weird I know today() - 1 works in constraints but it does not work for me in a calc.&lt;/P&gt;&lt;P&gt;This did work though&amp;nbsp; &amp;nbsp;today() - (1000*24*60*60*1)&lt;/P&gt;</description>
      <pubDate>Mon, 25 Mar 2024 18:28:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/use-yesterday-s-date-in-form-dependency-error/m-p/1400354#M55718</guid>
      <dc:creator>DougBrowning</dc:creator>
      <dc:date>2024-03-25T18:28:57Z</dc:date>
    </item>
    <item>
      <title>Re: Use yesterday's date in form, dependency error</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/use-yesterday-s-date-in-form-dependency-error/m-p/1400478#M55728</link>
      <description>&lt;P&gt;Thank you. That worked!&lt;/P&gt;</description>
      <pubDate>Mon, 25 Mar 2024 18:16:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/use-yesterday-s-date-in-form-dependency-error/m-p/1400478#M55728</guid>
      <dc:creator>JamieShinskie</dc:creator>
      <dc:date>2024-03-25T18:16:13Z</dc:date>
    </item>
  </channel>
</rss>

