Decoding a GS1 Barcode Group Separator

I need to decode the following which is returned from a barcode scan in a Flow Text Input field…

01037602085300401724030010VAB21334J – No Escape Sequences are Visible

Only searching for the possible variable length (AI) application identifiers, (10) and (21), the possible decoding results could be…
(01)03760208530040(17)240300(10)VAB(21)334J – (10)Lot Number and (21)Serial Number identified - ‘21’ could be seen as the AI (21).
Or
(01)03760208530040(17)240300(10)VAB21334J – Only a (10)Lot Number identified – ‘21’ could be seen as a part of the Lot Number.

I would only know which one is correct depending on the presence of the [FNC1]…
01037602085300401724030010VAB[FNC1]21334J
With the [FNC1] escape present, this would return…
(01)03760208530040(17)240300(10)VAB(21)334J
because I know where the variable length characters after the AI (10) ends.

Or
01037602085300401724030010VAB21334J
With no [FNC1] escape present, this would return…
(01)03760208530040(17)240300(10)VAB21334J

I’m having no luck with returning any escape sequences from the barcode.
I believe it might be \F that represents the [FNC1] that indicates the end of variable length segments.

The customer uses various industry standard barcode scanners.

Is there something fundamental I’m missing in trying to return and translate the escape sequences from the barcode into a Flow Text Input field?

Hey Steve,

if the escape character is part of the barcode it should be transmitted to the flow input field, but you will not be able to see it. Have you tried using Flowscript and search for chr(27) (which should be the escape character)?
When processing the input you can search for Chr(27) with e.g. the Instr Function and depending on wether you find it or not built your logic to get the individual flow values.

You can also copy the input and paste the flow input value to an ASCII converter online (e.g. Convert a String to ASCII Code - Online String Tools) to figure out the correct codes for any seperators/markes. Using Chr(xx) and the corrcect ASCII value will usually work.

Regards,

Johannes

Something like this:

If instr('MyString', chr(27)) > -1 {
//' Logic for including escape character here'
}
else
{
//' Logic for excluding escape character here'
}

Many thanks Johannes, I’ll give that a try.

Many thanks again Johannes.

No problems Steve. Did it work though? :slight_smile:

Hi Johannes,

I’m waiting for my customer to provide some more information.
I’ll try to remember to let you know how it does.

Many thanks,

Steve