<?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: Cost breakdown form with relevant fields. Sum fails because relevant defaults Null in ArcGIS Survey123 Questions</title>
    <link>https://community.esri.com/t5/arcgis-survey123-questions/cost-breakdown-form-with-relevant-fields-sum-fails/m-p/1345429#M52667</link>
    <description>&lt;P&gt;Thank you so much, that worked perfectly!&lt;/P&gt;</description>
    <pubDate>Fri, 03 Nov 2023 06:35:04 GMT</pubDate>
    <dc:creator>Cyprus_Forest_Department</dc:creator>
    <dc:date>2023-11-03T06:35:04Z</dc:date>
    <item>
      <title>Cost breakdown form with relevant fields. Sum fails because relevant defaults Null</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/cost-breakdown-form-with-relevant-fields-sum-fails/m-p/1344891#M52639</link>
      <description>&lt;P&gt;Hallo.&lt;/P&gt;&lt;P&gt;I have a form for breaking down the cost for treating monument trees.&lt;/P&gt;&lt;P&gt;The user chooses from a select multiple question one or many causes for treatment (${TreatmentType}).&lt;/P&gt;&lt;P&gt;Then the respective question pops up so as to populate the individual cost via a relevant expression (${TreatmentCostA} or/and ${TreatmentCostB}).&lt;/P&gt;&lt;P&gt;However, the total cost field (${TotalCost}) gets Null, when it has a calculation expresion to add the two fields (${TreatmentCostA} + ${TreatmentCostB}).&lt;/P&gt;&lt;P&gt;Found a post that inscribes to set the default values of ${TreatmentCostA} and ${TreatmentCostB} as 0 and then the ${TotalCost} indeed has the sum calculated, however leaving the ${TreatmentType} field potential empty.&lt;/P&gt;&lt;P&gt;Tried even to set a constrain for the ${TreatmentType} field&amp;nbsp;number(${TotalCost}) &amp;gt; 0 so as to prompt the user to go back and select the respective treatment that he populated the cost bellow but didn't manage to make it work.&lt;/P&gt;&lt;P&gt;Any ideas? Thank you guys for the help.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Nov 2023 12:20:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/cost-breakdown-form-with-relevant-fields-sum-fails/m-p/1344891#M52639</guid>
      <dc:creator>Cyprus_Forest_Department</dc:creator>
      <dc:date>2023-11-02T12:20:00Z</dc:date>
    </item>
    <item>
      <title>Re: Cost breakdown form with relevant fields. Sum fails because relevant defaults Null</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/cost-breakdown-form-with-relevant-fields-sum-fails/m-p/1344919#M52641</link>
      <description>&lt;P&gt;Remove the 0 defaults for your Treatment Costs fields and incorporate some if statements into your TotalCost calculation to account for the possible null values.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;if(selected(${TreatmentType}, 'A'), ${TreatmentCostA}, 0) + if(selected(${TreatmentType}, 'B'), ${TreatmentCostB}, 0) + if(selected(${TreatmentType}, 'C'), ${TreatmentCostC}, 0)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Basically, that calculation is saying if TreamentType A is selected, add that value, if not, add 0 instead. Repeated for Types B and C.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Nov 2023 12:58:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/cost-breakdown-form-with-relevant-fields-sum-fails/m-p/1344919#M52641</guid>
      <dc:creator>JenniferAcunto</dc:creator>
      <dc:date>2023-11-02T12:58:17Z</dc:date>
    </item>
    <item>
      <title>Re: Cost breakdown form with relevant fields. Sum fails because relevant defaults Null</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/cost-breakdown-form-with-relevant-fields-sum-fails/m-p/1345429#M52667</link>
      <description>&lt;P&gt;Thank you so much, that worked perfectly!&lt;/P&gt;</description>
      <pubDate>Fri, 03 Nov 2023 06:35:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/cost-breakdown-form-with-relevant-fields-sum-fails/m-p/1345429#M52667</guid>
      <dc:creator>Cyprus_Forest_Department</dc:creator>
      <dc:date>2023-11-03T06:35:04Z</dc:date>
    </item>
  </channel>
</rss>

