Showing results for 
Search instead for 
Did you mean: 
Frequent Visitor

Scrub Junk from Phone Numbers



So basically we have a form that users fill out and based on what they pick in the form, it texts different members in the company. We list the groups we want to text inside Excel, then based on what they pick in the form, it loops through the group IDs in Excel and pulls members from 365. Pulls their numbers from 365 and loops through each member to text them via Twillio.


This is all working perfectly but the issue is that if a number has formatting in it, it breaks. So the numbers have to be formatted 12345677878 instead of like (234) 567-7878. What's the easiest way to scrub the special characters from numbers before it passes it to Twillio? Right now we're trying to make sure every number we put into 365 is formatted without the characters but this isn't ideal. We would want it to look for parenthesis, periods, spaces, etc. The other challenge is that it has to begin with a country code (1).


Thanks for the help!


text groups.jpg

Super User
Super User

Hi @KuhnsKC 


You can try a nested replace function expression like : 
replace(replace(replace(replace(variables('Number'),')',''),'(',''),' ',''),'-','')


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

Helpful resources

UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (2,142)