<?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: If() statement in repeat section, integer question's 'calculation' column not functioning in ArcGIS Survey123 Questions</title>
    <link>https://community.esri.com/t5/arcgis-survey123-questions/if-statement-in-repeat-section-integer-question-s/m-p/1168913#M42428</link>
    <description>&lt;P&gt;Thank you very much,&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/16421"&gt;@DougBrowning&lt;/a&gt;! I will try that out. And I just may take you up on your offer!&lt;/P&gt;</description>
    <pubDate>Thu, 28 Apr 2022 17:01:52 GMT</pubDate>
    <dc:creator>archeomason</dc:creator>
    <dc:date>2022-04-28T17:01:52Z</dc:date>
    <item>
      <title>If() statement in repeat section, integer question's 'calculation' column not functioning</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/if-statement-in-repeat-section-integer-question-s/m-p/1168883#M42423</link>
      <description>&lt;P&gt;Hello, community -&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope someone might be able to help me troubleshoot a conditional formula in an integer question's 'calculation' field. The field is inside a repeat and the formula's condition references the repeat record's position(..).&lt;/P&gt;&lt;P&gt;For context: I've developed a form where the user records different soil strata as they dig. The attributes of each of these strata (color, consistency, observations, etc.) are recorded in a ${SoilLevel} repeat. The user records the top and bottom depth of each of these strata (see below).&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="FieldApp_AutoTopDepthCalculation.jpg" style="width: 200px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/40081i756D30119D2E7962/image-size/small?v=v2&amp;amp;px=200" role="button" title="FieldApp_AutoTopDepthCalculation.jpg" alt="FieldApp_AutoTopDepthCalculation.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I'd like the form to fill in each level's Top Depth (${SoilTopDepth}) automatically with "0" for the first level (${LevelNumber}) and the previous level's Bottom Depth (${SoilBotDepth}) for all levels after that.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The formula I'm using in the ${SoilTopDepth} field's "Calculation" column isn't populating the field on the form:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;if((position(..)=1), 0, (once(max(${SoilBotDepth}))))&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;For broader context, here's a screencap of the relevant section of the XLSForm:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="XLSForm_AutoTopDepthCalculation.jpg" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/40086i6E9519914293B65D/image-size/large?v=v2&amp;amp;px=999" role="button" title="XLSForm_AutoTopDepthCalculation.jpg" alt="XLSForm_AutoTopDepthCalculation.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Can someone point out what I might have wrong?&lt;/P&gt;&lt;P&gt;Also, I was curious if my calculation formula for the ${LevelNumber} field (&lt;EM&gt;once(count(${SoilLevel}))&lt;/EM&gt;) might work better if it were replaced with &lt;EM&gt;position(..).&amp;nbsp;&lt;/EM&gt;Just curious about that one...&lt;/P&gt;&lt;P&gt;Thank you in advance!&lt;/P&gt;</description>
      <pubDate>Thu, 28 Apr 2022 16:35:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/if-statement-in-repeat-section-integer-question-s/m-p/1168883#M42423</guid>
      <dc:creator>archeomason</dc:creator>
      <dc:date>2022-04-28T16:35:07Z</dc:date>
    </item>
    <item>
      <title>Re: If() statement in repeat section, integer question's 'calculation' column not functioning</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/if-statement-in-repeat-section-integer-question-s/m-p/1168904#M42426</link>
      <description>&lt;P&gt;I did this using max trick like this&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DougBrowning_0-1651164831159.png" style="width: 794px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/40098iF54B8A572E5F7C06/image-dimensions/794x189?v=v2" width="794" height="189" role="button" title="DougBrowning_0-1651164831159.png" alt="DougBrowning_0-1651164831159.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;This is a soil pit form.&amp;nbsp; We do share our forms out to the public if you just want mine.&amp;nbsp; Just pm me.&lt;/P&gt;&lt;P&gt;Hope that helps&lt;/P&gt;</description>
      <pubDate>Thu, 28 Apr 2022 16:55:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/if-statement-in-repeat-section-integer-question-s/m-p/1168904#M42426</guid>
      <dc:creator>DougBrowning</dc:creator>
      <dc:date>2022-04-28T16:55:05Z</dc:date>
    </item>
    <item>
      <title>Re: If() statement in repeat section, integer question's 'calculation' column not functioning</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/if-statement-in-repeat-section-integer-question-s/m-p/1168913#M42428</link>
      <description>&lt;P&gt;Thank you very much,&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/16421"&gt;@DougBrowning&lt;/a&gt;! I will try that out. And I just may take you up on your offer!&lt;/P&gt;</description>
      <pubDate>Thu, 28 Apr 2022 17:01:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/if-statement-in-repeat-section-integer-question-s/m-p/1168913#M42428</guid>
      <dc:creator>archeomason</dc:creator>
      <dc:date>2022-04-28T17:01:52Z</dc:date>
    </item>
    <item>
      <title>Re: If() statement in repeat section, integer question's 'calculation' column not functioning</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/if-statement-in-repeat-section-integer-question-s/m-p/1169056#M42438</link>
      <description>&lt;P&gt;That worked like a champ! Thank you very much.&amp;nbsp;&lt;/P&gt;&lt;P&gt;For what it's worth, I did have it working using the indexed-repeat() function, where it would populate from the previous record's (position(..)-1) bottom depth, but I had this warning prompt saying I had a circular reference that might cause errors in calculations. So I was trying to find a better option.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yours seems to work great. Thank you very much, sir.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Apr 2022 21:04:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/if-statement-in-repeat-section-integer-question-s/m-p/1169056#M42438</guid>
      <dc:creator>archeomason</dc:creator>
      <dc:date>2022-04-28T21:04:35Z</dc:date>
    </item>
  </channel>
</rss>

