<?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: Barcodes attributes longer than 16 characters, breaks Arcade popup script that incorporates C1Factor or C2Factor in Gas and Pipeline Questions</title>
    <link>https://community.esri.com/t5/gas-and-pipeline-questions/barcodes-attributes-longer-than-16-characters/m-p/1292238#M704</link>
    <description>&lt;P&gt;Thanks Tom... I just sent you an e-mail.&lt;/P&gt;</description>
    <pubDate>Tue, 23 May 2023 18:51:10 GMT</pubDate>
    <dc:creator>EdJuarbe</dc:creator>
    <dc:date>2023-05-23T18:51:10Z</dc:date>
    <item>
      <title>Barcodes attributes longer than 16 characters, breaks Arcade popup script that incorporates C1Factor or C2Factor</title>
      <link>https://community.esri.com/t5/gas-and-pipeline-questions/barcodes-attributes-longer-than-16-characters/m-p/1292046#M702</link>
      <description>&lt;P&gt;We are currently testing the Pipeline Tracking &amp;amp; Traceability data model and Arcade popup scripts developed by&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/11586"&gt;@TomDeWitte&lt;/a&gt;, and have stumbled on barcodes that do not conform to the ASTM F2897-15a 16 characters format.&lt;/P&gt;&lt;P&gt;During our testing, we came across a valve whose barcode decoded to a value that exceeded the anticipated 16-character format. Before changing the field width, the OOTB arcade scripts were a simple drap/drop in our Attribute Expression dialog.&amp;nbsp; No other changes were made.&amp;nbsp; Simple changing the field&lt;/P&gt;&lt;P&gt;Here's one example of the extracted barcode attribute: 'ELboG04njHV70Z90MW6 DEMO'.&amp;nbsp;&lt;/P&gt;&lt;P&gt;To allow the capture of the extended characters, we attempted to create a new longer barcode field, but after doing so, the arcade scripts for the popup failed to save correctly, resulting in this error: '&lt;SPAN class=""&gt;Execution Error:&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;Field not Found', which is odd since the field does exist, and prior to using a long field was not an issue.&amp;nbsp; I dug in and found by removing the '[text(C1FACTOR)] ' from the second to the last&amp;nbsp; line (Diameter &amp;amp; Wall Thickness scripts): 'var DIAM = DIAMETERDICTIONARY[text(C1FACTOR)];' the script allowed to save and the popup worked (although not sure what if what is being displayed is actually correct.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Similarly, the Diameter2 and WallThickness2 scripts has similar issue but removing the '[text(C2FACTOR)]' portion from the following line:&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;var DIAM = DIAMETERDICTIONARY[text(C2FACTOR)]; allow the script to be saved.&amp;nbsp; The C1FACTOR was not a problem if the array was removed from the script entirely.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;So, I'm a little confused exactly what the C1Factor/C2Factor is actually doing, I'm faced with 2 options:&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;SPAN&gt;Modify the arcade script to get around the 'Field not Found' error.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Find a way to automatically trim the barcode to 16 characters in the Field maps app.&amp;nbsp; We are currently manually removing the extra characters, which allows for the correct extraction of arcade popup values but which I feel is not going to be a reliable option.&amp;nbsp; Also, I would rather retain the full barcode value since it may contain additional information that would otherwise be lost if we don't retain it at time of installation.&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;SPAN&gt;Would appreciate any help with this, or thought on better alternatives?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;TL/DR: Discovered barcodes longer than 16 characters.&amp;nbsp; Database fields wider than 16 characters cause the Diameter, Diameter2, Wall Thickness, &amp;amp; Wall Thickness2 arcade script to fail with '&lt;SPAN class=""&gt;Execution Error:&lt;/SPAN&gt;&lt;SPAN&gt;Field not Found' when saving script.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 23 May 2023 13:02:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/gas-and-pipeline-questions/barcodes-attributes-longer-than-16-characters/m-p/1292046#M702</guid>
      <dc:creator>EdJuarbe</dc:creator>
      <dc:date>2023-05-23T13:02:21Z</dc:date>
    </item>
    <item>
      <title>Re: Barcodes attributes longer than 16 characters, breaks Arcade popup script that incorporates C1Factor or C2Factor</title>
      <link>https://community.esri.com/t5/gas-and-pipeline-questions/barcodes-attributes-longer-than-16-characters/m-p/1292204#M703</link>
      <description>&lt;P&gt;Hi Ed,&lt;/P&gt;&lt;P&gt;A very interesting set of circumstances you have encountered. Your example barcode with greater than the ASTM F2897 standard format of 16 characters is a first form me.&amp;nbsp; And then the issue of the Text() function somehow fixing a "Field not Found" error is an interesting situation. The failure to successfully write to the BARCODE (Text16) field is not surprising as it is defined to a length of 16 characters.&amp;nbsp;&lt;/P&gt;&lt;P&gt;As you noted the first 16 characters conform to the ASTM F2897.&amp;nbsp; When I decoded it, it read that this was a 1" Plug Valve by Elster Perfection. When I added the additional characters the script failed, due to the text string exceeding the size of the BARCODE text field.&lt;/P&gt;&lt;P&gt;For the pop-up script, it might benefit from some additional error handling to catch this type of issue. Would you please email me at: &lt;A href="mailto:tdewitte@esri.com" target="_blank"&gt;tdewitte@esri.com&lt;/A&gt;&amp;nbsp;so we can review your configuration and together figure out the best resolution.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Tom DeWitte&lt;/P&gt;&lt;P&gt;Esri Technical Lead - Natural Gas Industry&lt;/P&gt;</description>
      <pubDate>Tue, 23 May 2023 17:45:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/gas-and-pipeline-questions/barcodes-attributes-longer-than-16-characters/m-p/1292204#M703</guid>
      <dc:creator>TomDeWitte</dc:creator>
      <dc:date>2023-05-23T17:45:15Z</dc:date>
    </item>
    <item>
      <title>Re: Barcodes attributes longer than 16 characters, breaks Arcade popup script that incorporates C1Factor or C2Factor</title>
      <link>https://community.esri.com/t5/gas-and-pipeline-questions/barcodes-attributes-longer-than-16-characters/m-p/1292238#M704</link>
      <description>&lt;P&gt;Thanks Tom... I just sent you an e-mail.&lt;/P&gt;</description>
      <pubDate>Tue, 23 May 2023 18:51:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/gas-and-pipeline-questions/barcodes-attributes-longer-than-16-characters/m-p/1292238#M704</guid>
      <dc:creator>EdJuarbe</dc:creator>
      <dc:date>2023-05-23T18:51:10Z</dc:date>
    </item>
  </channel>
</rss>

