Hello Everyone,
I need some assistance with code creation whereby after I scan my barcode it will auto-populate another question on the form pertaining to "address". The calculated expressions are being applied in ArcGIS Field Maps within the Form. Please see code attached at the bottom of this posting.
I was first able to obtain some helpful code examples via github but I am definitely missing something. The examples on github center around extracting certain components from the barcode and converting them to descriptions versus the numeric code. For my situation, the entire barcode is equivalent to the address whereby each barcode is uniquely assigned to this address information.
My workflow for this is as such...I scan the barcode, it populates the "OldMeterNumber" field with 1NF314421199 and in turn populates my "Address" field with 69944 SUNNYFIELD RD.
At this point, it keeps coming up "Unknown".
Thank you for taking the time and assisting.
Jeff
var BARCODE = $feature.OldMeterNumber
var address = BARCODE
var d = Dictionary(
"1NF314421199", "69944 SUNNYFIELD RD")
if (hasKey(d, address)) {
return d[address]
} else {
return "Unknown"
}