Validation for Barcode Entry. Must contain at least one letter.

I have technicians rapidly scanning package Tracking numbers. On the labels there are up to 5 barcodes and the operators often scan the wrong one. I’ve solved most problems with a >14 character length validation.

However, valid entries must have at least one LETTER. Is there a better way than the following?

OR(CONTAINS([_THIS],“A”),
CONTAINS([_THIS],“B”),
CONTAINS([_THIS],“C”),
CONTAINS([_THIS],“D”),
CONTAINS([_THIS],“E”),
CONTAINS([_THIS],“F”),
CONTAINS([_THIS],“G”),
CONTAINS([_THIS],“H”),
CONTAINS([_THIS],“I”),
CONTAINS([_THIS],“J”),
CONTAINS([_THIS],“K”),
CONTAINS([_THIS],“L”)…

)

Where is the letter? It’s on any position of the code?

1 Like

Yes, can be anywhere. “Two major shipping company” examples.

1ZW9X8340309824856

JJD014600003548346519537267463

1 Like

Contains seems the best way in that case.

If the letter was at an exact position, you could use IN(), INDEX() and LIST()

IN() | AppSheet Help Center

INDEX() | AppSheet Help Center

INDEX() | AppSheet Help Center

1 Like

How about just NUMBER([tracking number]). This will give an answer of 0 for anything which contains a letter.

2 Likes

Good idea.

So it would be

Number([_THIS])=0

What’s the posibility of having a code without a letter and just zeros? If it’s low and almost impossible, it should work

1 Like

If you wanted to check for that unlikely event you could do the following:

and(
  number([_THIS]) = 0,
  len(substitute([_THIS],"0","")) > 0
)
1 Like

Thanks you two. Works perfectly.

1 Like