cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Talha
Level: Powered On

Use of If and substring expression in MS flow

Hi all,

 

i am having a two digit number ( variable) in compose output as 05, 45 etc

 

i need to check the second digit (red color), if second digits is Zero (0) then i need to remove the zero and use first digit.

if second digits is not zero then i need to use both digit.

 

i have tryed using expression in flow, but its show error message as The Expression is Invalid. the expression is 

if(substring(outputs('Compose'),0,1) = 0,substring(outputs('Compose'),1,1),outputs('Compose'))

please tell me what is wrong in my coding.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Use of If and substring expression in MS flow

Why make things complicated?

 

the following expression will remove any leading 0s

 

int(outputs('Compose'))
 
 

View solution in original post

1 REPLY 1
Super User
Super User

Re: Use of If and substring expression in MS flow

Why make things complicated?

 

the following expression will remove any leading 0s

 

int(outputs('Compose'))
 
 

View solution in original post

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

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

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

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!

Top Kudoed Authors (Last 30 Days)
Users online (4,626)