cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Advocate II
Advocate II

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
Highlighted

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
Highlighted

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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Upcoming Events

Experience what’s next for Power Automate

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Top Solution Authors
Top Kudoed Authors
Users online (4,387)