<?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 submission of form if geopoint is not within the city? in ArcGIS Survey123 Questions</title>
    <link>https://community.esri.com/t5/arcgis-survey123-questions/restrict-submission-of-form-if-geopoint-is-not/m-p/868470#M27566</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, after&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;I used pulldata on geopoint to extract full addres to field named "address",&lt;/SPAN&gt; I used this calculation for a required question: "Is geopoint within Zlatar Bistrica city?":&lt;/P&gt;&lt;PRE class="" style="color: #000000; background: #f5f2f0; border: 0px; font-size: 14px; margin: 0.5em 0px; padding: 1em 1em 1em 3.8em;"&gt;&lt;SPAN style="color: #3d3d3d;"&gt;if(contains(${address},'Zlatar Bistrica'), 'yes', null)&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;So, the result is that form can't be submitted if the geopoint is se ouside the city.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I'm working on a same form for a neighbour city called "Zlatar". But if I use analog calculation:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="" style="color: #000000; background: #f5f2f0; border: 0px; font-size: 14px; margin: 0.5em 0px; padding: 1em 1em 1em 3.8em;"&gt;&lt;SPAN style="color: #3d3d3d;"&gt;if(contains(${address},'Zlatar'), 'yes', null)&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;it is obvious that a geopoint can be set in city "Zlatar Bistrica", because contains "Zlatar" &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;. It shoudn't be posible, so how can I write a calculation for an address that must contain "Zlatar" and nust NOT contain "Bistrica"&amp;nbsp;at the same time?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks very much!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 17 Jul 2020 14:25:31 GMT</pubDate>
    <dc:creator>ŽeljkoPušec</dc:creator>
    <dc:date>2020-07-17T14:25:31Z</dc:date>
    <item>
      <title>Restrict submission of form if geopoint is not within the city?</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/restrict-submission-of-form-if-geopoint-is-not/m-p/868465#M27561</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;first, I used pulldata on geopoint to extract full addres to field named "address". My idea is to create calculation which will check if the full address with street name and number etc., contains name of the city. If not, then return value of null, and as it is requiered field, it will forbid submission of the form if the geolocation is set outside of that city.&lt;/P&gt;&lt;P&gt;Well, I'm not sure this logic is right, but the calculation I wrote sure isn't:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if(${address}) regex(., 'Zlatar Bistrica'), 1, null)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help would be much appreciated, thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Jun 2020 09:27:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/restrict-submission-of-form-if-geopoint-is-not/m-p/868465#M27561</guid>
      <dc:creator>ŽeljkoPušec</dc:creator>
      <dc:date>2020-06-04T09:27:30Z</dc:date>
    </item>
    <item>
      <title>Re: Restrict submission of form if geopoint is not within the city?</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/restrict-submission-of-form-if-geopoint-is-not/m-p/868466#M27562</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could set the constraint column with contains:&lt;/P&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;contains(${address},'Zlatar Bistrica')‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Jun 2020 19:17:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/restrict-submission-of-form-if-geopoint-is-not/m-p/868466#M27562</guid>
      <dc:creator>DanteLee</dc:creator>
      <dc:date>2020-06-04T19:17:23Z</dc:date>
    </item>
    <item>
      <title>Re: Restrict submission of form if geopoint is not within the city?</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/restrict-submission-of-form-if-geopoint-is-not/m-p/868467#M27563</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It works!&lt;/P&gt;&lt;P&gt;Thank you kindly for your reply!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Jun 2020 06:34:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/restrict-submission-of-form-if-geopoint-is-not/m-p/868467#M27563</guid>
      <dc:creator>ŽeljkoPušec</dc:creator>
      <dc:date>2020-06-05T06:34:06Z</dc:date>
    </item>
    <item>
      <title>Re: Restrict submission of form if geopoint is not within the city?</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/restrict-submission-of-form-if-geopoint-is-not/m-p/868468#M27564</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What about if you are only using the web version?&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Jun 2020 19:52:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/restrict-submission-of-form-if-geopoint-is-not/m-p/868468#M27564</guid>
      <dc:creator>Arlington_CoGISMC</dc:creator>
      <dc:date>2020-06-05T19:52:35Z</dc:date>
    </item>
    <item>
      <title>Re: Restrict submission of form if geopoint is not within the city?</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/restrict-submission-of-form-if-geopoint-is-not/m-p/868469#M27565</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I believe using formulas is only supported through S123 Connect right now, but I wouldn't be surprised if it's in the pipeline for the web version&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Jun 2020 14:36:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/restrict-submission-of-form-if-geopoint-is-not/m-p/868469#M27565</guid>
      <dc:creator>DanteLee</dc:creator>
      <dc:date>2020-06-08T14:36:50Z</dc:date>
    </item>
    <item>
      <title>Re: Restrict submission of form if geopoint is not within the city?</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/restrict-submission-of-form-if-geopoint-is-not/m-p/868470#M27566</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, after&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;I used pulldata on geopoint to extract full addres to field named "address",&lt;/SPAN&gt; I used this calculation for a required question: "Is geopoint within Zlatar Bistrica city?":&lt;/P&gt;&lt;PRE class="" style="color: #000000; background: #f5f2f0; border: 0px; font-size: 14px; margin: 0.5em 0px; padding: 1em 1em 1em 3.8em;"&gt;&lt;SPAN style="color: #3d3d3d;"&gt;if(contains(${address},'Zlatar Bistrica'), 'yes', null)&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;So, the result is that form can't be submitted if the geopoint is se ouside the city.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I'm working on a same form for a neighbour city called "Zlatar". But if I use analog calculation:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="" style="color: #000000; background: #f5f2f0; border: 0px; font-size: 14px; margin: 0.5em 0px; padding: 1em 1em 1em 3.8em;"&gt;&lt;SPAN style="color: #3d3d3d;"&gt;if(contains(${address},'Zlatar'), 'yes', null)&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;it is obvious that a geopoint can be set in city "Zlatar Bistrica", because contains "Zlatar" &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;. It shoudn't be posible, so how can I write a calculation for an address that must contain "Zlatar" and nust NOT contain "Bistrica"&amp;nbsp;at the same time?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks very much!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jul 2020 14:25:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/restrict-submission-of-form-if-geopoint-is-not/m-p/868470#M27566</guid>
      <dc:creator>ŽeljkoPušec</dc:creator>
      <dc:date>2020-07-17T14:25:31Z</dc:date>
    </item>
    <item>
      <title>Re: Restrict submission of form if geopoint is not within the city?</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/restrict-submission-of-form-if-geopoint-is-not/m-p/868471#M27567</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ah &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt; always a couple different ways about it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The "proper" way (in either case) would be to use pulldata + reversegeocode. Note: This consumes 0.04 credits for each reversegeocode statement that is run, so consider your survey traffic and credit limitations. This post has a good example for how to set up a single reversegeocode and use pulldata(@json,'..') for separate fields. See the attachment in the initial question - &lt;A href="https://community.esri.com/thread/234235"&gt;Survey123: Reverse Geocoding.&lt;/A&gt; At its most basic setup, it might look something like this in the calculation field to pull the city (assuming you're using the standard geocoder):&lt;/P&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;pulldata("@geopoint",${yourgeopointfieldname},"reversegeocode.address.City")‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;You could embed this within an if statement, or you could have a hidden calculation field if it helps you understand the process step-wise.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The alternate method I might suggest would be a compound if statement. In this case, it checks if the address is within Zlatar. (In other words, if address contains Zlatar AND it contains Bistrica, then it is not in Zlatar.)&lt;/P&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;if(contains(${address},'Zlatar') and contains(${address},'Bistrica'), 'no', 'yes')‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jul 2020 16:37:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/restrict-submission-of-form-if-geopoint-is-not/m-p/868471#M27567</guid>
      <dc:creator>DanteLee</dc:creator>
      <dc:date>2020-07-20T16:37:46Z</dc:date>
    </item>
  </channel>
</rss>

