Can we Verify Characters?

I was thinking past week if it’s possible to verify characters in entry componentes like:

  • Verify if a phone number has 11 characters
  • If an email has the @
  • If an ID number has the right number of characters

Summing up, if could be possible to count the number of characters in any entry component

Edit: I’ve already tried with Contains option, but it didn’t worked.

Hi Lucas,

If you are talking about the formulae to do that in the spreadsheet, here’s the way.

  • If a phone number has 11 characters, assuming the number is stored in A:

    = ARRAYFORMULA(IF(A2:A<>"",IF(LEN(A2:A)=11,TRUE,FALSE),""))

It must be noted that the number should be carefully formatted so that it does not lose the ‘0’ at the start in specific countries.

E.g: A phone number in Vietnam would look like 0123 456 789, when entered into Sheet as number, it will not take the 0 (as it’s not meaningful in a number context). It must be stored as text, or replace the ‘0’ with country’s prefix (in this case +84).

  • If an email has the @:

    =ARRAYFORMULA(IF(A2:A<>"",IF(IFERROR(FIND("@",A2:A),0)>0,TRUE,FALSE),"")

This FIND formula checks if the string in A has the letter “@” and returns its position. If it does not exist, the FIND formula will return a value error, hence the IFERROR to throw a 0 back instead of #VALUE!

  • If an ID number has the right number of characters

Same concept with the phone number, replace the number 11 with the desired number for checking.

Thanks for sharing @ThinhDinh

But actually I was thinking if it’s possible to do using only glide features

1 Like

Oh no problem then, hope someone else comes up with a solution. Have a nice week Lucas!

1 Like