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 / How to standardize tex...
Power Apps
Answered

How to standardize text in a format?

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello!!!
I have a text entry in my application and I wanted the user to type a document in the text box to be in a standard example:
12345678900 = 123.456.789-00

I have already used the text and validate function and was not successful.
Can someone help me?

Categories:
I have the same question (0)
  • mdevaney Profile Picture
    29,991 Moderator on at

    @Anonymous 

    Use 4 separate text boxes.  Put a label in the middle of each one with the desired syntax.  Change the MaxLength of each label to your requirement.  The user can press tab to skip to the next text box.

     

    Then join them together to submit the result:

     

    Text1.Text&”.”&Text2.Text&”.”Text3.Text&”-“&Tdxt4.Text


    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

     

     

  • Verified answer
    v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

    Could you please share a bit more about your scenario?

    Do you want to format the entered value 12345678900 as 123.456.789-00?

     

    I assume that you would enter 11 digit value within the Text Box, according to the needs that you mentioned, I think the OnChange property of the Text Input Box could achieve your needs.

    I have made a test on my side, please try the following workaround:

    Set the OnChange property of the Text Input Box to following:

    If(
     Len(TextInput1.Text) >= 11,
     Set(
     FormattedValue,
     Left(
     Left(TextInput1.Text, Len(TextInput1.Text)-2),
     3
     ) & "." &
     Right(
     Left(
     Left(TextInput1.Text, Len(TextInput1.Text)-2),
     6
     ),
     3
     ) & "." &
     Right(
     Left(TextInput1.Text, Len(TextInput1.Text)-2),
     3
     ) & "-" & Right(TextInput1.Text, 2)
     )
    )

    Set the Default property of the Text Input Box to following:

    FormattedValue

    Please check the following GIF screenshot for more details:

    Test.gif

    Note: The OnChange property of the Text Input Box would be fired only when the focus is moved away from the Text Input Box

     

    If you want the entered value within the Text Input box to be formatted automatically, I think the Timer control could achieve your needs. You could consider add a Timer control in your app, set the Duration property to following:

    1000

    set the AutoStart and Repeat property of the Timer control to following:

    true

    set the OnTimerEnd property to following:

    If(
     Len(TextInput1.Text) >= 11,
     Set(
     FormattedValue,
     Left(
     Left(TextInput1.Text, Len(TextInput1.Text)-2),
     3
     ) & "." &
     Right(
     Left(
     Left(TextInput1.Text, Len(TextInput1.Text)-2),
     6
     ),
     3
     ) & "." &
     Right(
     Left(TextInput1.Text, Len(TextInput1.Text)-2),
     3
     ) & "-" & Right(TextInput1.Text, 2)
     )
    )

    Set the Default property of the Text Input Box to following:

    FormattedValue

     

    Please consider take a try with above solution, then check if the issue is solved.

     

    Best regards,

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 April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 936

#2
Valantis Profile Picture

Valantis 604

#3
11manish Profile Picture

11manish 518

Last 30 days Overall leaderboard