<?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 Barcode Parsing and Java Trim() Function in ArcGIS Survey123 Questions</title>
    <link>https://community.esri.com/t5/arcgis-survey123-questions/barcode-parsing-and-java-trim-function/m-p/1190399#M43659</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I am working on building a Survey123 form where I am populating 14 fields from a single bar code scan. I know which string numbers correlates to which field, for example the ‘model’ field is characters 0-19 and can parse the data accordingly. In reality, the ‘model’ value will always be between 8 -12 characters long, never filling the 20 character spaces allotted for it within the bar code, therefore leaving white space at the end of the data entry. I would like to remove the whitespace after the entry and am trying to use the trim() Java script function. I have practically zero Java experience but have watched a handful of the Survey123 and Java YouTube videos. This is what my script looks like below and it does work when testing it:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ZacharyJaffe_0-1657206742490.png" style="width: 612px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/45442i313742EE1722C6A2/image-dimensions/612x367?v=v2" width="612" height="367" role="button" title="ZacharyJaffe_0-1657206742490.png" alt="ZacharyJaffe_0-1657206742490.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;When I copy the java script into my excel form and try to save it, it looks like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ZacharyJaffe_1-1657206742493.png" style="width: 789px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/45440i02E0020CD810F582/image-dimensions/789x75?v=v2" width="789" height="75" role="button" title="ZacharyJaffe_1-1657206742493.png" alt="ZacharyJaffe_1-1657206742493.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I am trying to parse the data and trim the blank space in the same calculation cell and get the following error:&lt;/P&gt;&lt;P&gt;“There has been a problem trying to replace ${&amp;lt;model&amp;gt;} with the XPath to the survey element named ‘&amp;lt;model&amp;gt;’. There is no survey element with this name.”&lt;/P&gt;&lt;P&gt;I try to create a calculate row with the Java script in it as pictured below and get the same error message.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ZacharyJaffe_2-1657206742495.png" style="width: 776px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/45441i08615B28806964A5/image-dimensions/776x86?v=v2" width="776" height="86" role="button" title="ZacharyJaffe_2-1657206742495.png" alt="ZacharyJaffe_2-1657206742495.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I am pretty stuck here trying to figure out how to trim/get rid of the white space and any help would be greatly appreciated!&lt;/P&gt;&lt;P&gt;Thank you very much,&lt;/P&gt;&lt;P&gt;Zach&lt;/P&gt;</description>
    <pubDate>Thu, 07 Jul 2022 15:22:35 GMT</pubDate>
    <dc:creator>ZacharyJaffe</dc:creator>
    <dc:date>2022-07-07T15:22:35Z</dc:date>
    <item>
      <title>Barcode Parsing and Java Trim() Function</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/barcode-parsing-and-java-trim-function/m-p/1190399#M43659</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I am working on building a Survey123 form where I am populating 14 fields from a single bar code scan. I know which string numbers correlates to which field, for example the ‘model’ field is characters 0-19 and can parse the data accordingly. In reality, the ‘model’ value will always be between 8 -12 characters long, never filling the 20 character spaces allotted for it within the bar code, therefore leaving white space at the end of the data entry. I would like to remove the whitespace after the entry and am trying to use the trim() Java script function. I have practically zero Java experience but have watched a handful of the Survey123 and Java YouTube videos. This is what my script looks like below and it does work when testing it:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ZacharyJaffe_0-1657206742490.png" style="width: 612px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/45442i313742EE1722C6A2/image-dimensions/612x367?v=v2" width="612" height="367" role="button" title="ZacharyJaffe_0-1657206742490.png" alt="ZacharyJaffe_0-1657206742490.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;When I copy the java script into my excel form and try to save it, it looks like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ZacharyJaffe_1-1657206742493.png" style="width: 789px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/45440i02E0020CD810F582/image-dimensions/789x75?v=v2" width="789" height="75" role="button" title="ZacharyJaffe_1-1657206742493.png" alt="ZacharyJaffe_1-1657206742493.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I am trying to parse the data and trim the blank space in the same calculation cell and get the following error:&lt;/P&gt;&lt;P&gt;“There has been a problem trying to replace ${&amp;lt;model&amp;gt;} with the XPath to the survey element named ‘&amp;lt;model&amp;gt;’. There is no survey element with this name.”&lt;/P&gt;&lt;P&gt;I try to create a calculate row with the Java script in it as pictured below and get the same error message.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ZacharyJaffe_2-1657206742495.png" style="width: 776px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/45441i08615B28806964A5/image-dimensions/776x86?v=v2" width="776" height="86" role="button" title="ZacharyJaffe_2-1657206742495.png" alt="ZacharyJaffe_2-1657206742495.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I am pretty stuck here trying to figure out how to trim/get rid of the white space and any help would be greatly appreciated!&lt;/P&gt;&lt;P&gt;Thank you very much,&lt;/P&gt;&lt;P&gt;Zach&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jul 2022 15:22:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/barcode-parsing-and-java-trim-function/m-p/1190399#M43659</guid>
      <dc:creator>ZacharyJaffe</dc:creator>
      <dc:date>2022-07-07T15:22:35Z</dc:date>
    </item>
    <item>
      <title>Re: Barcode Parsing and Java Trim() Function</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/barcode-parsing-and-java-trim-function/m-p/1200823#M44189</link>
      <description>&lt;P&gt;Anyone have any ideas? Any advice would be appreciated.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Aug 2022 15:09:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/barcode-parsing-and-java-trim-function/m-p/1200823#M44189</guid>
      <dc:creator>ZacharyJaffe</dc:creator>
      <dc:date>2022-08-09T15:09:45Z</dc:date>
    </item>
  </channel>
</rss>

