cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Masonf2265
Helper II
Helper II

Phone Number Not Updating

Hi Everyone, 

 

I have a phone number text input that changes the number into the correct format: (###) - ### - ####. I did this by setting the Phone # datacard update to:

If(IsMatch(ti_phone1.Text, "^\(\d{3}\) \d{3}-\d{4}$"),
ti_phone1.Text,
Blank()
)

 

The OnChange for ti_Phone # is: 

Set(formattedNumber, Text(Value(ti_phone1.Text), "[$-en-US](###) ###-####"))

 

 

and the Default is : Coalesce(formattedNumber,Parent.Default)

 

 

The overlay works perfectly but when I enter a number, save, and edit a different item, the phone number I entered previously overwrites the existing number.  I would like to edit the field and have the existing phone number remain. I do NOT want it to default back to the last record I edited. 

 

Any assistance would be much appreciated!

 

Thank you.

 

5 REPLIES 5
BCBuizer
Super User
Super User

Hi @Masonf2265 ,

 

The issue is in the Default property as your function will always return formattedNumber, which is updated last when working on the previous record. Not sure why this was implemented, but replacing it with simply Parent.Default should do the trick.



Did you like my post? Please give it a thumbs up! Did I resolve your issue? Please click Accept as Solution to close the topic and so other members of the community can find solutions more easily.

Hello, 

 

I tried this  but then my overlay function does not work. 

BCBuizer
Super User
Super User

Hi @Masonf2265 ,

 

The only option I can then think of is to set variable formattedNumber to Blank in parallel with submitting/resetting your form. The Coalesce() function will then skip it, returning Parent.Default.

 

 



Did you like my post? Please give it a thumbs up! Did I resolve your issue? Please click Accept as Solution to close the topic and so other members of the community can find solutions more easily.
BCBuizer
Super User
Super User

Hi @Masonf2265 ,

 

Did you have any joy finding the solution for your issue? If so, please mark the solution for other users to benefit.



Did you like my post? Please give it a thumbs up! Did I resolve your issue? Please click Accept as Solution to close the topic and so other members of the community can find solutions more easily.

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 (3,238)