<?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 update geopoint with calculation using if statement in ArcGIS Survey123 Questions</title>
    <link>https://community.esri.com/t5/arcgis-survey123-questions/update-geopoint-with-calculation-using-if/m-p/770652#M3668</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I'm setting up a QC Survey123 form and would like the editor be able to:&lt;/P&gt;&lt;P&gt;1.&amp;nbsp;move the map geopoint to a new&amp;nbsp;location,&lt;/P&gt;&lt;P&gt;2. record new location coordinates to two lat/long attribute fields&lt;/P&gt;&lt;P&gt;3. either save the form with the new location or revert back to the original location,&amp;nbsp;depending on whether they toggle a Yes/No question asking if they want to update the map with their loc or the originally reported location (stored in two other lat/log attribute fields).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Following calculation suggested in:&lt;A class="link-titled" href="https://doc.arcgis.com/en/survey123/desktop/create-surveys/geopoints.htm" title="https://doc.arcgis.com/en/survey123/desktop/create-surveys/geopoints.htm"&gt;Geopoints—Survey123 for ArcGIS | Documentation&lt;/A&gt;, I used the formula "&lt;SPAN style="color: #4c4c4c; background-color: #ffffff;"&gt;substr(${previous_question}, 0, 10) + " " + substr(${previous_question}, -10)&lt;/SPAN&gt;" to change the map location. However, I'm having difficulty toggling between two sets of coordinates, depending on the answer to the yes/no question (see examples below).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Calculation on geopoint&lt;/P&gt;&lt;P&gt;1. This works to force an update the geopoint&amp;nbsp;back to the original coords found in two, lat/long attribute fields:&lt;/P&gt;&lt;P&gt;(substr(${LatitudeReported}, 0, 10) + " " + substr(${LongitudeReported}, -10))...i.e. when I review the record again, the geopoint has been moved back to the originally reported location.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. This gives an error "ODK Validate Errors" when I try to save the form and include an if statement to update the geopoint between the two different choices from location attribute fields:&lt;/P&gt;&lt;P&gt;if((${IsLocationCorrected}=20),(substr(${LatitudeReported}, 0, 10) + " " + substr(${LongitudeReported}, -10)),(substr(${WSDOT_LatitudeStateRoute}, 0, 10) + " " + substr(${WSDOT_LongitudeStateRoute}, -10)))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Am I just mis-typing the formula or this not even possible to combine the if statement with the substring calculation when updating geopoint?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 29 Apr 2020 19:45:45 GMT</pubDate>
    <dc:creator>TregChristopher</dc:creator>
    <dc:date>2020-04-29T19:45:45Z</dc:date>
    <item>
      <title>update geopoint with calculation using if statement</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/update-geopoint-with-calculation-using-if/m-p/770652#M3668</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I'm setting up a QC Survey123 form and would like the editor be able to:&lt;/P&gt;&lt;P&gt;1.&amp;nbsp;move the map geopoint to a new&amp;nbsp;location,&lt;/P&gt;&lt;P&gt;2. record new location coordinates to two lat/long attribute fields&lt;/P&gt;&lt;P&gt;3. either save the form with the new location or revert back to the original location,&amp;nbsp;depending on whether they toggle a Yes/No question asking if they want to update the map with their loc or the originally reported location (stored in two other lat/log attribute fields).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Following calculation suggested in:&lt;A class="link-titled" href="https://doc.arcgis.com/en/survey123/desktop/create-surveys/geopoints.htm" title="https://doc.arcgis.com/en/survey123/desktop/create-surveys/geopoints.htm"&gt;Geopoints—Survey123 for ArcGIS | Documentation&lt;/A&gt;, I used the formula "&lt;SPAN style="color: #4c4c4c; background-color: #ffffff;"&gt;substr(${previous_question}, 0, 10) + " " + substr(${previous_question}, -10)&lt;/SPAN&gt;" to change the map location. However, I'm having difficulty toggling between two sets of coordinates, depending on the answer to the yes/no question (see examples below).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Calculation on geopoint&lt;/P&gt;&lt;P&gt;1. This works to force an update the geopoint&amp;nbsp;back to the original coords found in two, lat/long attribute fields:&lt;/P&gt;&lt;P&gt;(substr(${LatitudeReported}, 0, 10) + " " + substr(${LongitudeReported}, -10))...i.e. when I review the record again, the geopoint has been moved back to the originally reported location.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. This gives an error "ODK Validate Errors" when I try to save the form and include an if statement to update the geopoint between the two different choices from location attribute fields:&lt;/P&gt;&lt;P&gt;if((${IsLocationCorrected}=20),(substr(${LatitudeReported}, 0, 10) + " " + substr(${LongitudeReported}, -10)),(substr(${WSDOT_LatitudeStateRoute}, 0, 10) + " " + substr(${WSDOT_LongitudeStateRoute}, -10)))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Am I just mis-typing the formula or this not even possible to combine the if statement with the substring calculation when updating geopoint?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Apr 2020 19:45:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/update-geopoint-with-calculation-using-if/m-p/770652#M3668</guid>
      <dc:creator>TregChristopher</dc:creator>
      <dc:date>2020-04-29T19:45:45Z</dc:date>
    </item>
    <item>
      <title>Re: update geopoint with calculation using if statement</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/update-geopoint-with-calculation-using-if/m-p/770653#M3669</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Treg,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Did you find a solution for this workflow? If so, please share it on the forum.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Brett&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jul 2020 06:20:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/update-geopoint-with-calculation-using-if/m-p/770653#M3669</guid>
      <dc:creator>BrettStokes</dc:creator>
      <dc:date>2020-07-08T06:20:36Z</dc:date>
    </item>
  </channel>
</rss>

