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")...

)

Solved Solved
0 7 218
2 ACCEPTED SOLUTIONS

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

View solution in original post

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

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

View solution in original post

7 REPLIES 7

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

Yes, can be anywhere.  "Two major shipping company" examples.  

1ZW9X8340309824856

JJD014600003548346519537267463

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

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

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

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

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

Thanks you two.  Works perfectly.

Top Labels in this Space