<?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: calculation for turn HEX to decimal in survey123 connect? in ArcGIS Survey123 Questions</title>
    <link>https://community.esri.com/t5/arcgis-survey123-questions/calculation-for-turn-hex-to-decimal-in-survey123/m-p/1337847#M52274</link>
    <description>&lt;P&gt;You could use the parseInt() javascript function to convert hex numbers to integers.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;function hexToInt(hex) {
    return parseInt(hex, 16);
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then use the survey123 calculation:&lt;/P&gt;&lt;P&gt;pulldata("@javascript", "functions.js", "hexToInt", ${your_hex_field})&lt;/P&gt;</description>
    <pubDate>Fri, 13 Oct 2023 17:34:13 GMT</pubDate>
    <dc:creator>Raul</dc:creator>
    <dc:date>2023-10-13T17:34:13Z</dc:date>
    <item>
      <title>calculation for turn HEX to decimal in survey123 connect?</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/calculation-for-turn-hex-to-decimal-in-survey123/m-p/1337107#M52223</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;I need to turn Hex number to decimal values in survey123 connect for one question?&lt;/P&gt;&lt;P&gt;do we have any formula or work around to achieve this?&lt;/P&gt;&lt;P&gt;Best&lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2023 20:58:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/calculation-for-turn-hex-to-decimal-in-survey123/m-p/1337107#M52223</guid>
      <dc:creator>anonymous55</dc:creator>
      <dc:date>2023-10-11T20:58:47Z</dc:date>
    </item>
    <item>
      <title>Re: calculation for turn HEX to decimal in survey123 connect?</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/calculation-for-turn-hex-to-decimal-in-survey123/m-p/1337115#M52224</link>
      <description>&lt;P&gt;Is everyone using the form in your organization?&amp;nbsp; If so, you could use a JavaScript function, JS can convert hex to decimal pretty easily&lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2023 21:07:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/calculation-for-turn-hex-to-decimal-in-survey123/m-p/1337115#M52224</guid>
      <dc:creator>MobiusSnake</dc:creator>
      <dc:date>2023-10-11T21:07:14Z</dc:date>
    </item>
    <item>
      <title>Re: calculation for turn HEX to decimal in survey123 connect?</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/calculation-for-turn-hex-to-decimal-in-survey123/m-p/1337292#M52235</link>
      <description>&lt;P&gt;Should be doable via calculates.&lt;/P&gt;&lt;P&gt;From &lt;A href="https://www.binaryhexconverter.com/hex-to-decimal-converter" target="_blank"&gt;https://www.binaryhexconverter.com/hex-to-decimal-converter&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="abureaux_0-1697122008780.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/82932iCF5EA3E6FEA06D5A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="abureaux_0-1697122008780.png" alt="abureaux_0-1697122008780.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Oct 2023 14:47:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/calculation-for-turn-hex-to-decimal-in-survey123/m-p/1337292#M52235</guid>
      <dc:creator>abureaux</dc:creator>
      <dc:date>2023-10-12T14:47:22Z</dc:date>
    </item>
    <item>
      <title>Re: calculation for turn HEX to decimal in survey123 connect?</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/calculation-for-turn-hex-to-decimal-in-survey123/m-p/1337781#M52265</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/115587"&gt;@MobiusSnake&lt;/a&gt;&amp;nbsp;Hey unfortunately I don't know JS. &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Oct 2023 15:43:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/calculation-for-turn-hex-to-decimal-in-survey123/m-p/1337781#M52265</guid>
      <dc:creator>anonymous55</dc:creator>
      <dc:date>2023-10-13T15:43:07Z</dc:date>
    </item>
    <item>
      <title>Re: calculation for turn HEX to decimal in survey123 connect?</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/calculation-for-turn-hex-to-decimal-in-survey123/m-p/1337802#M52267</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/454586"&gt;@abureaux&lt;/a&gt;&amp;nbsp;do you know how can I use this calculation in survey123 Calculate field.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Oct 2023 16:02:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/calculation-for-turn-hex-to-decimal-in-survey123/m-p/1337802#M52267</guid>
      <dc:creator>anonymous55</dc:creator>
      <dc:date>2023-10-13T16:02:17Z</dc:date>
    </item>
    <item>
      <title>Re: calculation for turn HEX to decimal in survey123 connect?</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/calculation-for-turn-hex-to-decimal-in-survey123/m-p/1337847#M52274</link>
      <description>&lt;P&gt;You could use the parseInt() javascript function to convert hex numbers to integers.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;function hexToInt(hex) {
    return parseInt(hex, 16);
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then use the survey123 calculation:&lt;/P&gt;&lt;P&gt;pulldata("@javascript", "functions.js", "hexToInt", ${your_hex_field})&lt;/P&gt;</description>
      <pubDate>Fri, 13 Oct 2023 17:34:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/calculation-for-turn-hex-to-decimal-in-survey123/m-p/1337847#M52274</guid>
      <dc:creator>Raul</dc:creator>
      <dc:date>2023-10-13T17:34:13Z</dc:date>
    </item>
    <item>
      <title>Re: calculation for turn HEX to decimal in survey123 connect?</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/calculation-for-turn-hex-to-decimal-in-survey123/m-p/1337902#M52286</link>
      <description>&lt;P&gt;While java can do this with less steps, not everyone can use Java in their environment. To do this inside of S123 natively, you can use the attached (at least as a starting point).&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;input_txt&lt;BR /&gt;&lt;/STRONG&gt;Your HEX input (only built it for 4 digits, but didn't add a bind::esri:fieldLength).&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;input_stuff&lt;BR /&gt;&lt;/STRONG&gt;These calculates isolate the positions of the characters. E.g., &lt;STRONG&gt;substr(${input_txt}, 2, 3)&lt;/STRONG&gt; will grab the third character of the string within input_txt. It starts from 0, and reads left to right.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;convert_stuff&lt;BR /&gt;&lt;/STRONG&gt;Will convert the alpha character (A to F) into a decimal number (10 to 15), or return the decimal number (0 to 9) without changing it.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;calculate_stuff&lt;BR /&gt;&lt;/STRONG&gt;multiplies the number by 16^&lt;EM&gt;x&lt;/EM&gt;, where &lt;EM&gt;x&lt;/EM&gt; is the position (&lt;A href="https://www.binaryhexconverter.com/hex-to-decimal-converter" target="_self"&gt;This&lt;/A&gt; will explain better than me)&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;output_txt&lt;/STRONG&gt;&lt;BR /&gt;Your decimal output&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366FF"&gt;&lt;STRONG&gt;S123:&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="abureaux_1-1697223359728.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/83083i0F1B35532908CEF1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="abureaux_1-1697223359728.png" alt="abureaux_1-1697223359728.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#3366FF"&gt;Verification:&lt;/FONT&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="abureaux_3-1697223382348.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/83085i63EE7EE8BA57E919/image-size/medium?v=v2&amp;amp;px=400" role="button" title="abureaux_3-1697223382348.png" alt="abureaux_3-1697223382348.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Two things:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;You can simplify what I have done. I just have all the steps broken down and visible like that so you can see what it is doing. I also stopped at 4 digits because the pattern should be visible from that point.&lt;/LI&gt;&lt;LI&gt;I kind of messed up my original workflow. The 4 calculates under the &lt;EM&gt;input_stuff&lt;/EM&gt; group were originally in reverse order. Rather than redo &lt;EM&gt;everything&lt;/EM&gt;, I choose to swap their order (see below), which fixed everything. I am telling you this because, unfortunately, this adds an extra step for anyone that wants to expand this beyond 4 digits. Sorry!&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="abureaux_4-1697223587107.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/83086i99597AE75058C8FF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="abureaux_4-1697223587107.png" alt="abureaux_4-1697223587107.png" /&gt;&lt;/span&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;</description>
      <pubDate>Fri, 13 Oct 2023 19:09:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/calculation-for-turn-hex-to-decimal-in-survey123/m-p/1337902#M52286</guid>
      <dc:creator>abureaux</dc:creator>
      <dc:date>2023-10-13T19:09:07Z</dc:date>
    </item>
  </channel>
</rss>

