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
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Top Solution Authors
Top Kudoed Authors
Users online (2,593)