cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mrstian89
Helper IV
Helper IV

Phone directory - Number starting with 0

Hi!
We have an app we use as a phone directory in our company.

It uses a number column in Dataverse.

The issue is that when we add a special number, starting with a zero, this is removed and not shown in the app.


Is there a simple work around to be able to keep the starting zeros of the number, which does not required to rebuild the app and chagnge the column type to text?

5 REPLIES 5
Pstork1
Dual Super User
Dual Super User

If the numbers are always the same length you can adjust the app to format the number when it is displayed to include leading 0's.

TEXT(1234,"0000000")

would be formatted as 0001234



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Join me at 365 and PWR EduCon in Chicago
EduCon Chicago 2022

Thanks for responding! Unfortunately there are different lengths to the phone numbers added!

Then I think your only real choice is to redo the table with a text column for the number instead of a number.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Join me at 365 and PWR EduCon in Chicago
EduCon Chicago 2022

TheRobRush
Super User
Super User

What if they did something like so, where in my example TextInput3 is where the number is coming from.

Phoen numbers will only ever be 1 of a handful of formats right, 7 digits, 10 digits, 12, digits, and maybe 11?

If so this formula could be extended out for all the possibilities.

 

Switch(Len(TextInput3.Text),
7,
Text(Value(TextInput3.Text),"0000000"),
10,
Text(Value(TextInput3.Text),"0000000000"))
_____________________________________________________________________________________
Like my answer? - Hit that Thumbs Up. Resolved the Issue? - Hit Accept as Solution.
This helps others find solutions to future issues!
TheRobRush
Super User
Super User

Eh actually scratch that I didn't think about the fact that these numbers probably dropped the 0 going into sharepoint so the Len() check would not work really.

 

I think you could probably assume no phone number starts with more than two 0s though and then do a len check and round up to the nearest one of those mentioned before 7 10 11 or 12

 

somethign liek

Switch(Len(TextInput3.Text),
5,
Text(Value(TextInput3.Text),"0000000"),
6,
Text(Value(TextInput3.Text),"0000000"),
7,
Text(Value(TextInput3.Text),"0000000"),
8,
Text(Value(TextInput3.Text),"0000000000"),
9,
Text(Value(TextInput3.Text),"0000000000"),
10,
Text(Value(TextInput3.Text),"0000000000"))
_____________________________________________________________________________________
Like my answer? - Hit that Thumbs Up. Resolved the Issue? - Hit Accept as Solution.
This helps others find solutions to future issues!

Helpful resources

Announcements
Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Government Carousel

New forum: GCC, GCCH, DoD - Federal App Makers (FAM)

In response to the unique and evolving requirements of the United States public sector, Microsoft has created Power Apps US Government.

Users online (4,694)