# Phone Number Formatting and Validation

**URL:** <https://community.thunkable.com/t/phone-number-formatting-and-validation/920509>\
**Category:** Tutorials and DIY Guides\
**Tags:** community, text, tips\
**Created:** [October 21, 2020, 8:31pm UTC](https://community.thunkable.com/t/phone-number-formatting-and-validation/920509 "2020-10-21T20:31:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![darren](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/darren/32/69854_2.png) [@darren](https://community.thunkable.com/u/darren)\
**Post date:** [October 21, 2020, 8:31pm UTC](https://community.thunkable.com/t/phone-number-formatting-and-validation/920509/1 "2020-10-21T20:31:49Z")

</div>

### 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

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/3/03a766a6666ecfebbd2457d8f9f9dc89124480ae.png)

### Remarks

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

Cheers.

---

<div class="post-metadata">

**Author:** ![gpo](https://avatars.discourse-cdn.com/v4/letter/g/7993a0/32.png) [@gpo](https://community.thunkable.com/u/gpo)\
**Post date:** [October 27, 2020, 12:47am UTC](https://community.thunkable.com/t/phone-number-formatting-and-validation/920509/2 "2020-10-27T00:47:10Z")

</div>

Thank you Darren

---

<div class="post-metadata">

**Author:** ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)\
**Post date:** [November 8, 2024, 12:21pm UTC](https://community.thunkable.com/t/phone-number-formatting-and-validation/920509/3 "2024-11-08T12:21:55Z")

</div>


