Hello guys,
I hope everyone is doing great !
This is Raj, Here I am working on App and I have a requirement to format the Phone number in such a way that (###)-###-####.
Will , Any one please help me in that .
Thank you in advance,
Raj
Solved! Go to Solution.
Hi all!
I didn't like the complexity or functionality of any of the solutions I have found for this, so I wrote my own as follows. To start with I have hardcoded the output of a "Get My O365 Profile" request into a collection. I removed the O365 profile connector from my canvas apps and flow because I found it to be massively lagging the app launches, thus the hard-coded O365 profile JSON collected into the table which I'll be working with in the following code:
Concat(FirstN(Split(First(colO365Profile.mobilePhone).mobilePhone,""),3),ThisRecord.Result)&"-"&
Concat(LastN(FirstN(Split(First(colO365Profile.mobilePhone).mobilePhone,""),6),3),ThisRecord.Result)&"-"&
Concat(LastN(Split(First(colO365Profile.mobilePhone).mobilePhone,""),4),ThisRecord.Result)
This gives us a ###-###-#### format, but of course you could easily get other formats like:
"("&
Concat(FirstN(Split(First(colO365Profile.mobilePhone).mobilePhone,""),3),ThisRecord.Result)&") "&
Concat(LastN(FirstN(Split(First(colO365Profile.mobilePhone).mobilePhone,""),6),3),ThisRecord.Result)&"-"&
Concat(LastN(Split(First(colO365Profile.mobilePhone).mobilePhone,""),4),ThisRecord.Result)
to get (###) ###-#### format.
The other solution I saw were here and here.
I was unable to get phone number input masking working for the default value of a text input field, which I'm prepopulating with calculated values from other fields and from that hard-coded O365 profile collection. It seems that input masking only works for labels and other non-editable fields, as I think I've seen others mention as well.
The above method is simple, quick, and easy code that's not difficult to parse. I couldn't parse the more complicated solutions at a glance, so that's a no-go for me, especially when an easier solution for my use case is so easily doable.
Hope it's helpful!
Hello Team ,
I tried with above code if you try enter on 9 digit the value is resetting
If I typed the above number the values are resting to