cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Nani
Frequent Visitor

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

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

2 ACCEPTED SOLUTIONS

Accepted Solutions
Anonymous
Not applicable

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

View solution in original post

mdevaney
Super User
Super User

@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

View solution in original post

11 REPLIES 11
Anonymous
Not applicable

like this?

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

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 

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.

Anonymous
Not applicable

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

Hai Markus,

Thank you very much for your help.

 

Raj

Anonymous
Not applicable

@Nani

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

DrJasonScalmato
New Member

The Air Mail Envelope on the Floor

mdevaney
Super User
Super User

@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
New Member

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!

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (5,349)