Phone Number Formatting and Validation

Background

Currently I am working on a project that stores and retrieves phone numbers in AirTable. I was running into an issue with formatting the phone number correctly and I came up with a solution to format the phone number as you type in the text input.

Concept

Basically, every time the value changes, I strip out the non-number characters and then reformat the phone number in my desired format.

Goal

The following blocks format the number as: (###) ###-####

Properties

I also set the keyboard type to numeric and max-input length (advanced property) to 14.

Blocks

Remarks

Yes there are other (cleaner) ways to do this, but this gets the job done.

Cheers.

4 Likes

Thank you Darren

1 Like