<?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: Correct syntax for evaluating integers in If statements in ArcGIS Survey123 Questions</title>
    <link>https://community.esri.com/t5/arcgis-survey123-questions/correct-syntax-for-evaluating-integers-in-if/m-p/778254#M5526</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sounds like the Select option is the wrong approach, but if so, I’m not sure why a specific value works. (I did try it Section as a string format.) Here is what I am trying to do: “If there is a legitimate value for Section, then the location resolution ($&lt;SPAN __jive_macro_name="loc_res"&gt;&lt;/SPAN&gt;) is “TRS”; otherwise it is “DPA”.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 12 Sep 2019 21:28:50 GMT</pubDate>
    <dc:creator>bobwright</dc:creator>
    <dc:date>2019-09-12T21:28:50Z</dc:date>
    <item>
      <title>Correct syntax for evaluating integers in If statements</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/correct-syntax-for-evaluating-integers-in-if/m-p/778250#M5522</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Greetings,&lt;/P&gt;&lt;P&gt;I am trying calculating a field based on an If statement: if(selected(${section},'&amp;gt;=1'),${town},${permit_area}). However, this does not appear to be working because it always produces the false response (${permit_area}). If I do this: if(selected(${section},'1'),${town},${permit_area}) and set ${section} to 1, it produces the true response (${town}. I'm assuming it's a syntax error in the former and I've tried everything I can think of. I do not get error messages with either of these approaches. The evaluation attribute (${section}) is integer. I have tried it with the field I am trying to calculate defined as string and with no definition. Any help would be greatly appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Sep 2019 19:04:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/correct-syntax-for-evaluating-integers-in-if/m-p/778250#M5522</guid>
      <dc:creator>bobwright</dc:creator>
      <dc:date>2019-09-12T19:04:48Z</dc:date>
    </item>
    <item>
      <title>Re: Correct syntax for evaluating integers in If statements</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/correct-syntax-for-evaluating-integers-in-if/m-p/778251#M5523</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If I follow I think your issue is that drop down lists are always strings.&amp;nbsp; So using a &amp;gt;=1 makes no sense.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The way it is written you are asking if the string&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;'&amp;gt;=1' has been selected.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Sep 2019 20:00:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/correct-syntax-for-evaluating-integers-in-if/m-p/778251#M5523</guid>
      <dc:creator>DougBrowning</dc:creator>
      <dc:date>2019-09-12T20:00:32Z</dc:date>
    </item>
    <item>
      <title>Re: Correct syntax for evaluating integers in If statements</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/correct-syntax-for-evaluating-integers-in-if/m-p/778252#M5524</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Doug,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the response. It is straight data entry, or a feed from Explorer for ArcGIS. See below. If the user enters a value for Section, then I want to calculate the field of interest (hidden) with Township ($&lt;SPAN __jive_macro_name="town"&gt;&lt;/SPAN&gt;). If Section is missing, I want to populate the field of interest with DPA. All are of type Integer. Does that help any?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bob&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Sep 2019 20:55:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/correct-syntax-for-evaluating-integers-in-if/m-p/778252#M5524</guid>
      <dc:creator>bobwright</dc:creator>
      <dc:date>2019-09-12T20:55:13Z</dc:date>
    </item>
    <item>
      <title>Re: Correct syntax for evaluating integers in If statements</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/correct-syntax-for-evaluating-integers-in-if/m-p/778253#M5525</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The selected command is for drop downs not data entry.&amp;nbsp; And I think all drops downs are string.&amp;nbsp; So you are kinda losing me.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Sep 2019 21:13:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/correct-syntax-for-evaluating-integers-in-if/m-p/778253#M5525</guid>
      <dc:creator>DougBrowning</dc:creator>
      <dc:date>2019-09-12T21:13:25Z</dc:date>
    </item>
    <item>
      <title>Re: Correct syntax for evaluating integers in If statements</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/correct-syntax-for-evaluating-integers-in-if/m-p/778254#M5526</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sounds like the Select option is the wrong approach, but if so, I’m not sure why a specific value works. (I did try it Section as a string format.) Here is what I am trying to do: “If there is a legitimate value for Section, then the location resolution ($&lt;SPAN __jive_macro_name="loc_res"&gt;&lt;/SPAN&gt;) is “TRS”; otherwise it is “DPA”.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Sep 2019 21:28:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/correct-syntax-for-evaluating-integers-in-if/m-p/778254#M5526</guid>
      <dc:creator>bobwright</dc:creator>
      <dc:date>2019-09-12T21:28:50Z</dc:date>
    </item>
    <item>
      <title>Re: Correct syntax for evaluating integers in If statements</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/correct-syntax-for-evaluating-integers-in-if/m-p/778255#M5527</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you mean just check if it is blank then&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;if(${section}="",${town},${permit_area})&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;If section is a number I think you have to do this if I remember right.&amp;nbsp; Yea I know string length on a number but until it is filled in it is blank.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;SPAN&gt;if(string-length(${section})=0,${town},${permit_area})&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Sep 2019 22:20:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/correct-syntax-for-evaluating-integers-in-if/m-p/778255#M5527</guid>
      <dc:creator>DougBrowning</dc:creator>
      <dc:date>2019-09-12T22:20:17Z</dc:date>
    </item>
    <item>
      <title>Re: Correct syntax for evaluating integers in If statements</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/correct-syntax-for-evaluating-integers-in-if/m-p/778256#M5528</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/219322"&gt;bob wright&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Two suggestions:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;"section" is a reserved word in XMLForms.&amp;nbsp; If that is the name of your selection type or text box&amp;nbsp;you may want to use something different such as "section_num"&lt;/LI&gt;&lt;LI&gt;try using the following assuming you are checking against a select_one field or text box:&lt;/LI&gt;&lt;/OL&gt;&lt;P style="padding-left: 60px;"&gt;&lt;STRONG&gt;if(${section_num} &amp;gt;= 1, ${town}, ${permit_area})&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;This will return {town} for any value grater than 1 if it is selected/input in {section_num} and {permit_area} if zero or less.&amp;nbsp; I am not quite sure if you are using a dropdown or text field.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Sep 2019 23:51:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/correct-syntax-for-evaluating-integers-in-if/m-p/778256#M5528</guid>
      <dc:creator>LanceCole</dc:creator>
      <dc:date>2019-09-12T23:51:57Z</dc:date>
    </item>
    <item>
      <title>Re: Correct syntax for evaluating integers in If statements</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/correct-syntax-for-evaluating-integers-in-if/m-p/778257#M5529</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Lance Cole I did try the code you suggested with ${section}, but was still getting error messages. I did not know section was reserved, hence the unexplained squirreliness. Your suggestion to use something else worked. Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Sep 2019 17:37:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/correct-syntax-for-evaluating-integers-in-if/m-p/778257#M5529</guid>
      <dc:creator>bobwright</dc:creator>
      <dc:date>2019-09-13T17:37:30Z</dc:date>
    </item>
    <item>
      <title>Re: Correct syntax for evaluating integers in If statements</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/correct-syntax-for-evaluating-integers-in-if/m-p/778258#M5530</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Opps missed the Reserved Word.&amp;nbsp; Note that in Excel on the Types tap it lists all the reserved words for you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Sep 2019 19:30:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/correct-syntax-for-evaluating-integers-in-if/m-p/778258#M5530</guid>
      <dc:creator>DougBrowning</dc:creator>
      <dc:date>2019-09-16T19:30:55Z</dc:date>
    </item>
  </channel>
</rss>

