No show of leading zero's on scan but need to enforce numeric value

I understand AppSheet does not recognize leading zeros in a numerical value but client requires only numeric values in the field and needs to see the leading number during entry for confirmation

If I revert to data type of Text on the field - how do enforce only numeric values in the field?

@Daisy_Ramirez
Can you exemplify?

Client requires a 10-digit number of the bar code field.

Client inputs 0345645678 but will see the validation check error since AppSheet doesn’t recognize the leading zero.

image

@Daisy_Ramirez
That’s so normal because no any integer can start with zero, therefore a 10 digit number can only begin with 1

1 Like

Hi. A “Valid If” statement could help here. Here’s a simple example (image pasted below). I tried this out, if I scan a number and then afterwards attempt to change it to text, it won’t let me. I didn’t have anything nearby to scan that included text… perhaps you can test on your end?

1 Like

if 10 digit is a must then it shall be:

AND(
    LEN([_THIS])=10,
    NUMBER([_THIS])>0
)
3 Likes

In the details for a number column, you can tell it to always display 10 digits, which will have leading zeros. I don’t know if it helps you on entering the numbers and validating them.

3 Likes

@Bahbus
Have you tested your proposition?

1 Like

Only so far as displaying them. Not on the entering of them. But it should at least help simplify things for @Daisy_Ramirez. Even if AppSheet isn’t saving the leading zeroes into the underlying spreadsheet/database.

2 Likes

Alrighty…this worked like a charm!

AND(
LEN([_THIS])=10,
NUMBER([_THIS])>0
)

Thanks everyone for the different ideas. I’ll keep this as reference for future use as well.

:slight_smile:

2 Likes