cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
viveka
Frequent Visitor

Use of If in substring expression in MS flow- The expression is invalid

Hi all,

 

I'm having following issue.

 

If the length of the message is > 220, get the first 220 characters else show the existing message.

 

But it says following expression is invalid 😞 

 

if(length(outputs('Compose_3')) greater 220, substring(outputs('Compose_3'),0,220),outputs('Compose_3'))

 

Can anyone tell me how to write the above expresison correctly?

 

Thank you

1 ACCEPTED SOLUTION

Accepted Solutions
Pstork1
Dual Super User III
Dual Super User III

You have to write the Greater than as a function.

if(greater(length(outputs('Compose_3')),220),substring(outputs('Compose_3'),0,220),outputs('Compose_3'))


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

View solution in original post

2 REPLIES 2
Pstork1
Dual Super User III
Dual Super User III

You have to write the Greater than as a function.

if(greater(length(outputs('Compose_3')),220),substring(outputs('Compose_3'),0,220),outputs('Compose_3'))


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

View solution in original post

viveka
Frequent Visitor

Thank you so much for the help. It worked 😊🤗

Helpful resources

Announcements
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!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Users online (3,008)