<?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 Are Boolean and mathematical operators allowed in the same formula? (Or &amp; div) in ArcGIS Survey123 Questions</title>
    <link>https://community.esri.com/t5/arcgis-survey123-questions/are-boolean-and-mathematical-operators-allowed-in/m-p/864739#M26717</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm working on a survey that calculates the value &lt;EM&gt;radius&lt;/EM&gt; based on a&amp;nbsp;&lt;EM&gt;diameter&lt;/EM&gt; value that changes depending on another part of the form. In Survey123 Connect on Windows the first scenario works but it does not work on a web form. The second scenario works in both Windows and the web. &lt;STRONG&gt;Should the first one work in both places?&lt;/STRONG&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It appears the inner parentheses is always evaluated to&amp;nbsp;&lt;STRONG&gt;1&lt;/STRONG&gt; in scenario&amp;nbsp;1, regardless&amp;nbsp;of the terms.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H2&gt;Scenario 1: Round Pipe with Boolean&lt;/H2&gt;&lt;P&gt;&lt;STRONG&gt;variables&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;decimal DIAMETER_ROUND set to&amp;nbsp;&lt;EM&gt;5.5&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;decimal HORIZONTAL is &lt;EM&gt;null&lt;/EM&gt; and hidden by relevancy&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;formula&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;double RADIUS&amp;nbsp;calculate &lt;SPAN style="color: #ff00ff;"&gt;(${DIAMETER_ROUND} or&amp;nbsp;${HORIZONTAL}) div 2&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;results&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Windows: 2.75 (correct)&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;Web form: 0.5 (wrong)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H2&gt;Scenario 2: Round Pipe&amp;nbsp;with if/then&lt;/H2&gt;&lt;P&gt;&lt;STRONG&gt;variables&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;decimal DIAMETER_ROUND set to&amp;nbsp;&lt;EM&gt;5.5&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;decimal HORIZONTAL is&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;null&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;and hidden by relevancy&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;formula&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;double RADIUS&amp;nbsp;calculate&lt;SPAN&gt;&amp;nbsp;&lt;SPAN style="color: #ff00ff;"&gt;if(${PIPE_SHAPE}="round",${DIAMETER_ROUND} div 2,${HORIZONTAL} div 2)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;result&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Windows:&amp;nbsp;&lt;/SPAN&gt;2.75 (correct)&lt;/P&gt;&lt;P&gt;Web form: 2.75 (correct)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 12 Feb 2019 23:34:18 GMT</pubDate>
    <dc:creator>ElliottPlack__SHA_</dc:creator>
    <dc:date>2019-02-12T23:34:18Z</dc:date>
    <item>
      <title>Are Boolean and mathematical operators allowed in the same formula? (Or &amp; div)</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/are-boolean-and-mathematical-operators-allowed-in/m-p/864739#M26717</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm working on a survey that calculates the value &lt;EM&gt;radius&lt;/EM&gt; based on a&amp;nbsp;&lt;EM&gt;diameter&lt;/EM&gt; value that changes depending on another part of the form. In Survey123 Connect on Windows the first scenario works but it does not work on a web form. The second scenario works in both Windows and the web. &lt;STRONG&gt;Should the first one work in both places?&lt;/STRONG&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It appears the inner parentheses is always evaluated to&amp;nbsp;&lt;STRONG&gt;1&lt;/STRONG&gt; in scenario&amp;nbsp;1, regardless&amp;nbsp;of the terms.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H2&gt;Scenario 1: Round Pipe with Boolean&lt;/H2&gt;&lt;P&gt;&lt;STRONG&gt;variables&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;decimal DIAMETER_ROUND set to&amp;nbsp;&lt;EM&gt;5.5&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;decimal HORIZONTAL is &lt;EM&gt;null&lt;/EM&gt; and hidden by relevancy&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;formula&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;double RADIUS&amp;nbsp;calculate &lt;SPAN style="color: #ff00ff;"&gt;(${DIAMETER_ROUND} or&amp;nbsp;${HORIZONTAL}) div 2&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;results&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Windows: 2.75 (correct)&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;Web form: 0.5 (wrong)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H2&gt;Scenario 2: Round Pipe&amp;nbsp;with if/then&lt;/H2&gt;&lt;P&gt;&lt;STRONG&gt;variables&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;decimal DIAMETER_ROUND set to&amp;nbsp;&lt;EM&gt;5.5&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;decimal HORIZONTAL is&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;null&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;and hidden by relevancy&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;formula&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;double RADIUS&amp;nbsp;calculate&lt;SPAN&gt;&amp;nbsp;&lt;SPAN style="color: #ff00ff;"&gt;if(${PIPE_SHAPE}="round",${DIAMETER_ROUND} div 2,${HORIZONTAL} div 2)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;result&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Windows:&amp;nbsp;&lt;/SPAN&gt;2.75 (correct)&lt;/P&gt;&lt;P&gt;Web form: 2.75 (correct)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Feb 2019 23:34:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/are-boolean-and-mathematical-operators-allowed-in/m-p/864739#M26717</guid>
      <dc:creator>ElliottPlack__SHA_</dc:creator>
      <dc:date>2019-02-12T23:34:18Z</dc:date>
    </item>
    <item>
      <title>Re: Are Boolean and mathematical operators allowed in the same formula? (Or &amp; div)</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/are-boolean-and-mathematical-operators-allowed-in/m-p/864740#M26718</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Elliott,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't think I would expect the first formula to work properly - the part&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff00ff; background-color: #ffffff;"&gt;(${DIAMETER_ROUND} or&amp;nbsp;${HORIZONTAL})&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;creates a true/false comparison. &amp;nbsp;In the interpreter used by the field app, this yields the first non-null value (&lt;A href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Logical_Operators"&gt;a quirk of javascript&lt;/A&gt;). &amp;nbsp;The web form adheres to a more strict definition and returns true or false only - in javascript, this gets converted to 1 or 0 for the division step.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Feb 2019 23:40:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/are-boolean-and-mathematical-operators-allowed-in/m-p/864740#M26718</guid>
      <dc:creator>JamesTedrick</dc:creator>
      <dc:date>2019-02-13T23:40:47Z</dc:date>
    </item>
    <item>
      <title>Re: Are Boolean and mathematical operators allowed in the same formula? (Or &amp; div)</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/are-boolean-and-mathematical-operators-allowed-in/m-p/864741#M26719</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yea i agree.&amp;nbsp; You can test the fields to see if they are hidden using ''.&lt;/P&gt;&lt;P&gt;So&amp;nbsp;&lt;/P&gt;&lt;P&gt;if(${DIAMETER_ROUND} != ''; ${DIAMETER_ROUND} div 2,&amp;nbsp;${HORIZONTAL} div 2)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just like your second statement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Apr 2019 17:48:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/are-boolean-and-mathematical-operators-allowed-in/m-p/864741#M26719</guid>
      <dc:creator>DougBrowning</dc:creator>
      <dc:date>2019-04-25T17:48:31Z</dc:date>
    </item>
    <item>
      <title>Re: Are Boolean and mathematical operators allowed in the same formula? (Or &amp; div)</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/are-boolean-and-mathematical-operators-allowed-in/m-p/864742#M26720</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks. Does the '' test work on integers or float/double variables?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Apr 2019 17:54:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/are-boolean-and-mathematical-operators-allowed-in/m-p/864742#M26720</guid>
      <dc:creator>ElliottPlack__SHA_</dc:creator>
      <dc:date>2019-04-25T17:54:34Z</dc:date>
    </item>
    <item>
      <title>Re: Are Boolean and mathematical operators allowed in the same formula? (Or &amp; div)</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/are-boolean-and-mathematical-operators-allowed-in/m-p/864743#M26721</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yep i think so&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Apr 2019 18:00:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/are-boolean-and-mathematical-operators-allowed-in/m-p/864743#M26721</guid>
      <dc:creator>DougBrowning</dc:creator>
      <dc:date>2019-04-25T18:00:48Z</dc:date>
    </item>
  </channel>
</rss>

