Hi @patty789 ,
Do you want to format the phone number within a text box?
Currently, there is no functions supported to format a phone number within a text box within PowerApps.
As an alternative solution, you could consider check if the number you entered within the Text box matches a phone number (force you enter a Phone number into the Text box).
The user @shabila97 has faced a similar issue with you, please check my response within the following thread:
https://powerusers.microsoft.com/t5/General-Discussion/Validate-telephone-number/m-p/260211
Set the OnChange property of the Text Input box (TextInput1) to following:
If(
Not(IsMatch(TextInput1.Text, "\d{10}")) && !IsBlank(TextInput1.Text),
Notify("The Phone number you typed is not valid, please re-type again. The format is xxxxxxxxxx", NotificationType.Error); Reset(TextInput1)
)
You could also consider make the border color of the Text Input as Red when typing a invalid phone number using the following formula:
Set the BorderColor property of the Text Input box to following:
If(
Not(IsMatch(TextInput1.Text, "\d{10}")) && !IsBlank(TextInput1.Text),
RGBA(255, 0, 0, 1), /* <-- If not match, border color turn into red */
RGBA(0, 18, 107, 1)
)
Then add a Label control under the Text box, set the Text property to following:
"The Phone number you typed is not valid, please re-type again. The format is xxxxxxxxxx"
Set the Color property of the Label to following:
RGBA(255, 0, 0, 1)
Set the Visible property of the Label to following:
If(
Not(IsMatch(TextInput1.Text, "\d{10}")) && !IsBlank(TextInput1.Text),
true,
false
)
Please take a try with above solution, check if the issue is solved.
Best regards,