<?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: Performing calculations only if fields are &amp;quot;empty&amp;quot; in ArcGIS Survey123 Questions</title>
    <link>https://community.esri.com/t5/arcgis-survey123-questions/performing-calculations-only-if-fields-are-quot/m-p/802830#M11232</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It works &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;THANKS so much&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 10 Mar 2018 00:36:43 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2018-03-10T00:36:43Z</dc:date>
    <item>
      <title>Performing calculations only if fields are "empty"</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/performing-calculations-only-if-fields-are-quot/m-p/802828#M11230</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Survey123 community,&lt;/P&gt;&lt;P&gt;I have a couple of "dateTime" questions with calculations alongside them to assist users.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And in some case the users may manually overwrite these values before submitting.&lt;/P&gt;&lt;P&gt;But, if an user were to view one of those surveys from their 'inbox or sent folder,' it'll display the calculated value, rather than what was submitted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, I was wondering whether it is possible to ONLY perform a calculation, if the respective field is empty.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Attached below is a sample calculation.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;date-time(decimal-date-time(today()) + 15.29166669)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Gee&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Mar 2018 19:51:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/performing-calculations-only-if-fields-are-quot/m-p/802828#M11230</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2018-03-09T19:51:52Z</dc:date>
    </item>
    <item>
      <title>Re: Performing calculations only if fields are "empty"</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/performing-calculations-only-if-fields-are-quot/m-p/802829#M11231</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I got something like this working by putting &lt;STRONG&gt;if(string-length(respective field)=0,do time calculation, respective field)&lt;/STRONG&gt; in the calculation column of the question I wanted calculated.&amp;nbsp; In your simple calculation it would be &lt;STRONG&gt;if(string-length(${respectiveFieldName})=0,date-time(decimal-date-time(today()) + 15.29166669),${respectiveFieldName})&lt;/STRONG&gt;.&amp;nbsp; This would make it so the calculated field would do the calculation if the respective field is empty otherwise if the user were to overwrite the respective field it would display the overwrite they did. I hope this helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Mar 2018 20:43:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/performing-calculations-only-if-fields-are-quot/m-p/802829#M11231</guid>
      <dc:creator>deleted-user-PF38P_WNl02r</dc:creator>
      <dc:date>2018-03-09T20:43:34Z</dc:date>
    </item>
    <item>
      <title>Re: Performing calculations only if fields are "empty"</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/performing-calculations-only-if-fields-are-quot/m-p/802830#M11232</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It works &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;THANKS so much&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 10 Mar 2018 00:36:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/performing-calculations-only-if-fields-are-quot/m-p/802830#M11232</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2018-03-10T00:36:43Z</dc:date>
    </item>
    <item>
      <title>Re: Performing calculations only if fields are "empty"</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/performing-calculations-only-if-fields-are-quot/m-p/802831#M11233</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks again for the solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But, is there a way to make both - &lt;STRONG&gt;&lt;EM&gt;calculated and respective&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;fields the &lt;STRONG&gt;same&lt;/STRONG&gt;?&lt;/P&gt;&lt;P&gt;I currently get an error when I try and do this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Gee&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Mar 2018 23:50:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/performing-calculations-only-if-fields-are-quot/m-p/802831#M11233</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2018-03-12T23:50:46Z</dc:date>
    </item>
    <item>
      <title>Re: Performing calculations only if fields are "empty"</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/performing-calculations-only-if-fields-are-quot/m-p/802832#M11234</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/3966"&gt;Ismael Chivite&lt;/A&gt;‌ &lt;A href="https://community.esri.com/migrated-users/3263"&gt;James Tedrick&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;Do you guys know if it possible to keep&amp;nbsp;&lt;STRONG style="border: 0px; font-weight: bold;"&gt;&lt;EM style="border: 0px; font-weight: inherit;"&gt;calculated and respective&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&amp;nbsp;fields the &lt;/SPAN&gt;&lt;STRONG style="border: 0px; font-weight: bold;"&gt;same&lt;/STRONG&gt; with the above equation?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Gee&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Mar 2018 20:41:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/performing-calculations-only-if-fields-are-quot/m-p/802832#M11234</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2018-03-14T20:41:20Z</dc:date>
    </item>
    <item>
      <title>Re: Performing calculations only if fields are "empty"</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/performing-calculations-only-if-fields-are-quot/m-p/802833#M11235</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Geethaka,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you share a copy of your xlsx form and the error you are getting?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Phil.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Mar 2018 23:17:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/performing-calculations-only-if-fields-are-quot/m-p/802833#M11235</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2018-03-14T23:17:17Z</dc:date>
    </item>
    <item>
      <title>Re: Performing calculations only if fields are "empty"</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/performing-calculations-only-if-fields-are-quot/m-p/802834#M11236</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Phil, for getting back to me so quickly.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Copies of my&amp;nbsp;"xlsx form/error message" are&amp;nbsp;attached above.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Gee&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Mar 2018 23:35:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/performing-calculations-only-if-fields-are-quot/m-p/802834#M11236</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2018-03-14T23:35:46Z</dc:date>
    </item>
    <item>
      <title>Re: Performing calculations only if fields are "empty"</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/performing-calculations-only-if-fields-are-quot/m-p/802835#M11237</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Geethaka,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The issue is that you are using the&amp;nbsp;string-length(${startDate})&amp;nbsp;calculation on the same field&amp;nbsp;&lt;SPAN&gt;${startDate}. This creates a dependency&amp;nbsp;cycle as there is no answer in&amp;nbsp;${startDate} until it is selected but you are trying to run a calculation&amp;nbsp;on it before it is selected.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The&amp;nbsp;string-length(${startDate}) would&amp;nbsp;need to be in a following question and reference the previous question, and you can could use null field types to achieve what you are after with your&amp;nbsp;&lt;/SPAN&gt;calculations. Using calculations and relevance on the same question is ok, provided you don't create a&amp;nbsp;&lt;SPAN&gt;dependency&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;cycle by trying to run&amp;nbsp;a calculation&amp;nbsp;on the same field the input is required from.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Phil.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Mar 2018 00:12:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/performing-calculations-only-if-fields-are-quot/m-p/802835#M11237</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2018-03-15T00:12:20Z</dc:date>
    </item>
    <item>
      <title>Re: Performing calculations only if fields are "empty"</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/performing-calculations-only-if-fields-are-quot/m-p/802836#M11238</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Phil for the explanation.&lt;/P&gt;&lt;P&gt;Gee&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Mar 2018 01:54:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/performing-calculations-only-if-fields-are-quot/m-p/802836#M11238</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2018-03-15T01:54:48Z</dc:date>
    </item>
  </channel>
</rss>

