//Script for UPDM 2019 Data Models
//Script to decode and populate the MANUFACTURER value from the BARCODE value

var barcode = $feature.BARCODE;
if (barcode == null) // Preserve original MANUFACTURER value if BARCODE is null  
  return $feature.MANUFACTURER;
  
var mfrCode = mid(barcode,0,2);

if (mfrCode == '35' ) return 'Industrial Pipe Fittings';
if (mfrCode == '73' ) return 'Plasson';
if (mfrCode == '78' ) return 'Torre Gas, S.L.';
if (mfrCode == 'AD' ) return 'A-D Technologies';
if (mfrCode == 'AG' ) return 'Agru America Inc';
if (mfrCode == 'AY' ) return 'A.Y. McDonald Mfg Co.';
if (mfrCode == 'CE' ) return 'Centennial Plastics, Inc';
if (mfrCode == 'CH' ) return 'Charter Plastics Inc';
if (mfrCode == 'CI' ) return 'Continental Industries';
if (mfrCode == 'CP' ) return 'Georg Fischer Central Plastics LLC';
if (mfrCode == 'DR' ) return 'Dresser Pipeline Solutions';
if (mfrCode == 'EL' ) return 'Elster Perfection';
if (mfrCode == 'EN' ) return 'Endot Industries Inc';
if (mfrCode == 'FR' ) return 'IPEX Inc';
if (mfrCode == 'GB' ) return 'Gas Breaker Inc';
if (mfrCode == 'HF' ) return 'Valencia Pipe Company';
if (mfrCode == 'IN' ) return 'Innoge';
if (mfrCode == 'IU' ) return 'IPEX USA LLC';
if (mfrCode == 'JM' ) return 'J-M Manufacturing Co.';
if (mfrCode == 'KT' ) return 'Kerotest Manufacturing Corp';
if (mfrCode == 'MT' ) return 'M.T. Deason Co. inc';
if (mfrCode == 'NG' ) return 'Nupi Americas';
if (mfrCode == 'PE' ) return 'Performance Pipe';
if (mfrCode == 'PL' ) return 'Pipeline Plastics, LLC';
if (mfrCode == 'PP' ) return 'DuraLine';
if (mfrCode == 'PT' ) return 'Polytubes LP';
if (mfrCode == 'PV' ) return 'PolyValve LLC';
if (mfrCode == 'RP' ) return 'Rahn Plastics';
if (mfrCode == 'RW' ) return 'R.W. Lyall';
if (mfrCode == 'SB' ) return 'Smith-Blair Inc';
if (mfrCode == 'TD' ) return 'T.D. Williamson';
if (mfrCode == 'TP' ) return 'Teel Pipe LLC';
if (mfrCode == 'UI' ) return 'Uponor Infra Limited';
if (mfrCode == 'UP' ) return 'United Poly Systems';
if (mfrCode == 'VP' ) return 'Versaprofiles Inc';
if (mfrCode == 'WL' ) return 'WL Plastics';

return 'No domain value found for: ' + mfrCode;