cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
LukeSmith
Level: Power Up

Remove Zeros

Hi There

 

I am collecting telephone numbers from an MS Form. The telephone number needs to have a prefix 0 stripped to meet international dialing requirements.

 

I'm aware I could modify the form to advise the contributor to remove the 0 but this isn't practical for our form contributors.

 

Is there a expresion that I may use to remove prefix zeros from a telephone number?

 

Thank you

2 REPLIES 2
Super User
Super User

Re: Remove Zeros

Hi @LukeSmith 

 

Try the below expression and see if this solves your requirement. You will need to replace all instances of triggerBody()?['text'with the value you want to strip the 0 from.

 

if(equals(startsWith(triggerBody()?['text'],'0'),true),substring(triggerBody()?['text'],1,sub(length(triggerBody()?['text']),1)),triggerBody()?['text'])
 
 

Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!


Follow me on Twitter at @QG_LeeJHarris

Or on LinkedIn at in/leejharris

LukeSmith
Level: Power Up

Re: Remove Zeros

Thanks for your suggestion!

 

I instead converted the values to integers and this consequently removed the prefix zero.

 

Thank you again.

 

Helpful resources

Announcements
firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

firstImage

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Users online (6,164)