web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Formatting Phone Numbe...
Power Apps
Answered

Formatting Phone Number i.e (###)-###-###

(0) ShareShare
ReportReport
Posted on by 18

Hello guys,

I hope everyone is doing great !

This is Raj, Here I am working on App and I have a requirement to format the Phone number in such a way that (###)-###-####.

Will , Any one please help me in that . 

Thank you in advance,

Raj

Categories:
I have the same question (0)
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    like this?

    Text=        Text(Value(TextInput1.Text),"[$-de-DE](000)-000-000")

  • Nani Profile Picture
    18 on at

    Hai Markus,

    Thank you very much for your reply,

     

    As you mentioned in reply Text= Text(Value(TextInput1.Text),"[$-de-DE](000)-000-000") is it only for "Text" data type , or any other data types  like "Phone" . Because In my app I used Phone Datatype to PhoneNumber (Field).And it is Showing HtmlText instead Text. Will you help me with this scenario.

    Thank you

    Raj 

  • AndyPennell Profile Picture
    Microsoft Employee on at

    Markus' suggestion will only work for numeric fields.

     

    PowerApps have no concept of a "Phone" data type. Your data source will be exposed such a field as either a Text or Number.

     

    If it is Text then you can format it using the various string operators.

  • Verified answer
    Community Power Platform Member Profile Picture
    Microsoft Employee on at

    there is a different in view and edit, in view there is htmltext used.

    but because there is showing ABC it seems a string/alphanumeric is used for phone type so Brackets and Plus/Minus can be saved with number. this "a href" is a web link with url. if you click the app for registered "tel:" opens.

    i believe a formatted input control is on the wishlist.

    maybe using 3 textinput boxes and make a new string with it, but its not user friendly.

    you can add extra data area with your own components that not direct belongs your recordset if you will make tel. no. input.

     

    Ashampoo_Snap_2016.12.06_19h18m29s_001_.png

  • Nani Profile Picture
    18 on at

    Hai Markus,

    Thank you very much for your help.

     

    Raj

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @Nani

    ok, i hope i helped, i am new to powerapps myself since 2-3 weeks 🙂

  • DrJasonScalmato Profile Picture
    2 on at

    The Air Mail Envelope on the Floor

  • Verified answer
    mdevaney Profile Picture
    29,991 Moderator on at

    @Nani 
    Yes, you can automatically format a phone number as the user types it by creating an “input mask.”  It’s amazing to watch the phone number dashes appear automatically as you type!  Check out this article to learn how.


    Link to article:

    https://www.matthewdevaney.com/power-apps-phone-number-formatting-in-a-form-input-mask/

    powerapps-inputmask-forums.gif

  • Bstanley Profile Picture
    6 on at

    I must be missing something.  I did exactly as written and the phone number does not appear.  In fact after each digit is input, it disappears.  There is a problem with one of the formulas but i cannot figure it out.  Please Help!

  • HEATFreight Profile Picture
    1,024 on at

    Hi all!

    I didn't like the complexity or functionality of any of the solutions I have found for this, so I wrote my own as follows. To start with I have hardcoded the output of a "Get My O365 Profile" request into a collection. I removed the O365 profile connector from my canvas apps and flow because I found it to be massively lagging the app launches, thus the hard-coded O365 profile JSON collected into the table which I'll be working with in the following code:

    Concat(FirstN(Split(First(colO365Profile.mobilePhone).mobilePhone,""),3),ThisRecord.Result)&"-"&
    Concat(LastN(FirstN(Split(First(colO365Profile.mobilePhone).mobilePhone,""),6),3),ThisRecord.Result)&"-"&
    Concat(LastN(Split(First(colO365Profile.mobilePhone).mobilePhone,""),4),ThisRecord.Result)


    This gives us a ###-###-#### format, but of course you could easily get other formats like:

    "("&
    Concat(FirstN(Split(First(colO365Profile.mobilePhone).mobilePhone,""),3),ThisRecord.Result)&") "&
    Concat(LastN(FirstN(Split(First(colO365Profile.mobilePhone).mobilePhone,""),6),3),ThisRecord.Result)&"-"&
    Concat(LastN(Split(First(colO365Profile.mobilePhone).mobilePhone,""),4),ThisRecord.Result)

    to get (###) ###-#### format.

    The other solution I saw were here and here.

    I was unable to get phone number input masking working for the default value of a text input field, which I'm prepopulating with calculated values from other fields and from that hard-coded O365 profile collection. It seems that input masking only works for labels and other non-editable fields, as I think I've seen others mention as well.

    The above method is simple, quick, and easy code that's not difficult to parse. I couldn't parse the more complicated solutions at a glance, so that's a no-go for me, especially when an easier solution for my use case is so easily doable.

    Hope it's helpful!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 530

#2
WarrenBelz Profile Picture

WarrenBelz 459 Most Valuable Professional

#3
Haque Profile Picture

Haque 314

Last 30 days Overall leaderboard