web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Trim and format phone ...
Power Automate
Unanswered

Trim and format phone number

(0) ShareShare
ReportReport
Posted on by 20

Hi Experts,

 

I have string which is a phone number, I want to remove the 1(country code) in the number if it exist and then format it. I don't know if there is connector to use or expression if any and how to write an expression for this. Please help.

 

Example:

if the input is 13214325432, I would like to have it as 321-432-5432.

If the input is  3214325432, I would like to have it as 321-432-5432.

 

For now the first character will be either 1 or nothing as shown above since we deal with only US.

 

Thanks in advance for your help.

Categories:
I have the same question (0)
  • CFernandes Profile Picture
    8,402 Most Valuable Professional on at

    @Davy 

     

    @Jcook has excellently explained this in his blog post https://flowaltdelete.ca/2020/07/02/power-automate-format-phone-number-easy/ 

     

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

  • Davyjones Profile Picture
    20 on at

    @CFernandes Thanks for your response.

    I came across that post too, it does not explain trimming the 1 when it occurs.

  • Verified answer
    CFernandes Profile Picture
    8,402 Most Valuable Professional on at

    @Davy  No worries, you want to remove the 1.

     

    Compose 1 - string(13214325432)
    Compose 2 - substring(outputs('Compose'),1,sub(length(outputs('Compose')),1))
     
     
     

    Untitled.png

     

    Output

     

     

    Untitled.png

     

     

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

  • Davyjones Profile Picture
    20 on at

    @CFernandes  Thanks for taking your time in helping me.

     

    You have got me way forward than where I was. One last thing since its now string which is what i what in the end. How do i seperate it as ###-###-#### because @Jcook article helps us to format a number and since this is now a string please let me how can this be done.

     

    Thanks in advance for your response.

     

  • Verified answer
    CFernandes Profile Picture
    8,402 Most Valuable Professional on at

    @Davy 

     

    Sure thing. You can convert to number by using the fomula

    int(outputs('Compose_2'))

     

    CFernandes_0-1599856981467.png

     

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

     

  • Davyjones Profile Picture
    20 on at

    Thank you so much, for your time and solution with screenshots.

  • CFernandes Profile Picture
    8,402 Most Valuable Professional on at

    @Davy I am glad my solution worked 🙂. Have a wonderful weekend..

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard