Skip to content
Menu
SharePoint Gems
  • Power Platform
  • Development
    • SharePoint 2013
  • Migration
  • Administration
  • SP Online
  • Contact
  • About
    • Privacy Policy
SharePoint Gems

Validate phone number column in SharePoint

Posted on May 18, 2020September 29, 2021

Hello SharePointers,
Today in this article, we will learn to validate phone number columns in SharePoint Online.

In our day to day SharePoint development life we need to work on various aspects of technology. Also, we face too many technical challenges as a developer.

Contents hide
1 Context
2 Solution
2.1 We can achieve this by multiple ways. Please go through each step below to fulfill your requirement.
3 Another Way to format phone number field in SharePoint.
3.1 Share this:
3.2 Like this:
3.3 Related

Context

The Same challenge I faced during recent working on SharePoint Online List. As you all know, the SharePoint Number field (Telephone No.) always store comma-separated values as shown in the below image.

Validate phone number column in SharePoint
Validate phone number column in SharePoint

But our client requirement was to display a Telephone Number in the United States (US) writing format, i.e. (308) 555-4444 [Whose number is this?]

The basic requirement is like,
1) Users can enter a Telephone number in a standard way like 1234567890.
2) But at the backend, in list view, Telephone Number should look like (123) 456-7890

Solution

We can achieve this by multiple ways. Please go through each step below to fulfill your requirement.

The best and very speedy as well as very easy way to achieve our target is by using Calculated columns.

Follow below steps to create calculated column.

  1. Go to List where you want to validate the Telephone Number column in SharePoint.
  2. Click on Gear icon from Top right corner and Select List Settings
Validate phone number column in SharePoint
Validate phone number column in SharePoint
  1. Then Click on Add new Column and give a name like “Telephone Num”.
  2. Type of Column must be Calculated (calculation based on other columns)
  3. Add a formula =TEXT([Telephone No.],”(000) 000-0000″)
  4. click on OK.
Validate phone number column in SharePoint
Validate phone number column in SharePoint

This will display a general number column in the United States telephone number format.

Validate phone number column in SharePoint
Validate phone number column in SharePoint

Another Way to format phone number field in SharePoint.

Hey guys, don’t go away. If you don’t like the above approach, we always have another way to Format or validate the SharePoint column.

For this we need to follow below steps:

  1. Create a telephone number column
  2. Select column type as Single line Text
  3. Go to Column Validation
  4. Just copy and paste below formula in Column validation and click on OK

=AND(LEN([Phone])=14,IF(ISERROR(FIND("(", [Phone],1)),FALSE,(FIND("(", [Phone]) = 1)),IF(ISERROR(FIND(")", [Phone],5)),FALSE,(FIND(")", [Phone], 5) = 5)),IF(ISERROR(FIND(" ", [Phone],6)),FALSE,(FIND(" ", [Phone], 6) = 6)),IF(ISERROR(FIND("-", [Phone],10)),FALSE,(FIND("-", [Phone], 10) = 10)),IF(ISERROR(1*CONCATENATE(MID([Phone], 2, 3), MID([Phone], 7, 3), MID([Phone], 11, 4))),FALSE,AND(1*CONCATENATE(MID([Phone], 2, 3), MID([Phone], 7, 3), MID([Phone], 11, 4)) > 1000000000,1*MID([Phone], 2, 3) <> 911,1*MID([Phone], 7, 3) <> 911,1*MID([Phone], 7, 3) <> 555)))

Chris kent given a very good information about this formula.

Hope you like this post.

Comment below if this post helped you.

Share this:

  • Print
  • Twitter
  • Facebook
  • LinkedIn
  • WhatsApp
  • Telegram
  • Pinterest
  • Reddit

Like this:

Like Loading...

Related

8 thoughts on “Validate phone number column in SharePoint”

  1. ปั้มไลค์ says:
    July 16, 2020 at 12:09 PM

    Like!! I blog quite often and I genuinely thank you for your information. The article has truly peaked my interest.

    Loading...
    Reply
  2. ทิชชู่เปียกแอลกอฮอล์ says:
    July 16, 2020 at 12:10 PM

    I learn something new and challenging on blogs I stumbleupon everyday.

    Loading...
    Reply
  3. กรองหน้ากากอนามัย says:
    July 16, 2020 at 12:11 PM

    A big thank you for your article.

    Loading...
    Reply
  4. SMS says:
    July 16, 2020 at 12:14 PM

    bookmarked!!, I like your blog!

    Loading...
    Reply
  5. Lynne says:
    January 8, 2021 at 12:54 AM

    Neither of these solutions worked.

    Loading...
    Reply
    1. SharePointGems says:
      January 8, 2021 at 1:52 PM

      This is a working solutions.. Can you please give more details about your code.

      Loading...
      Reply
  6. Pingback: Retrieve SharePoint List Items using CSOM - SharePoint Gems
  7. Mulugeta Lemenih Kassaye says:
    September 11, 2023 at 6:35 PM

    So helpful, thank you so much.

    Loading...
    Reply

Leave a ReplyCancel reply

  • Development
  • Migration
  • Poweer Apps
  • Power Automate
  • Power Platform
  • SharePoint 2013
  • SharePoint Administration
  • SharePoint Online
  • Tips
  • Uncategorized

Best of Computers

Blog Stats

  • 67,509 hits

Subscribe

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 1,433 other subscribers
Buy Me Coffee
©2025 SharePoint Gems | Powered by WordPress and Superb Themes!
%d