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 / OnChange only triggers...
Power Apps
Answered

OnChange only triggers with user input

(0) ShareShare
ReportReport
Posted on by 2
I’m currently setting up a power app that asks for a users phone number. I want to make to do that the phone number will automatically format the number so that the user doesn’t need to enter the dashes on their own.
 
I had this working by following this tutorial https://www.matthewdevaney.com/power-apps-phone-number-formatting-in-a-form-input-mask/ but a coworker attempted to change the app to automatically take the phone number from the user field and the masking stopped working.
 
The masking works by having an onChange on a slider which is tied to the phone number input but after the change made to the form, the onChange no longer updates the field automatically and only functions if the user physically moves the slider which won’t even be visible in the finished product.
 
Has anyone run into this issue and if so how do I rectify it?
I have the same question (0)
  • Suggested answer
    11manish Profile Picture
    3,333 on at
    Use the Phone TextInput OnChange
     
    UpdateContext({
        varPhone:
        Text(
            Value(Self.Text),
            "[$-en-US](###) ###-####"
        )
    })
    Then set:
    • TextInputPhone.Default = varPhone
    It will be look like:
     
  • Verified answer
    Kalathiya Profile Picture
    2,456 Super User 2026 Season 1 on at
     
    Instead of doing using hidden slicer you can implement the number formatting directly in the TextInput’s OnChange property and then use that variable in the control Default property.
     
    On Change Property: 
    UpdateContext({
        formattedPhone:
        Text(
            Value(Self.Text),
            "[$-en-US](###) ###-####"
        )
    });
    Reset(Self);
     
    Default Property: 
    formattedPhone
    If this response resolves your issue, please mark it as the Verified Answer so it can help other community members as well.
    ---------------------------------------------------------------------------------

    📩 Need more help? Just mention @Kalathiya and I’ll be happy to assist.

    ✔️ If this answer helped you, please tick “Does this answer your question?” so it can be marked as the Verified Answer.

    💛 A Like always motivates me to keep contributing!

    ​​​​​​​
     
  • Suggested answer
    WarrenBelz Profile Picture
    155,838 Most Valuable Professional on at
    I have a blog on a similar requirement using a different process (this one is formatted currency, but the principle is the same), but you are correct that OnChange only triggers on a control from user input - this is the designed behaviour.
     
    So I am assuming here that the logged-in user has either a lookup to a list somewhere and this is a number
    LookUp(
       List,
       EmailField = User().Email
    ).PhoneField
    or you are using Entra
    Office365Users.MyProfileV2().mobilePhone
    So at App OnStart - either 
    Set(
       gblUserPhone,
       Text(
          Value(
             LookUp(
                List,
                EmailField = User().Email
             ).PhoneField
          ),
          "(###) ###-####"
       )
    )
    or
    Set(
       gblUserPhone,
       Text(
          Value(Office365Users.MyProfileV2().mobilePhone),
          "(###) ###-####"
       )
    )
    That way you simply set the control value to gblUserPhone (or whatever you want to call the Variable).
     
    Taking this a bit further (refer to my blog above), you may need to allow for existing values - so use
    Coalesce(
       ThisItem.YourFieldName,
       gblUserPhone
    )
    which will then use the existing field if it exists (on an edit form)
     
    Please Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider answering Yes to Was this reply helpful? or give it a Like
    Visit my blog
    Practical Power Apps    LinkedIn  

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 424

#2
WarrenBelz Profile Picture

WarrenBelz 355 Most Valuable Professional

#3
11manish Profile Picture

11manish 290

Last 30 days Overall leaderboard