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

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
Dual Super User
Dual Super User

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

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
Dual Super User
Dual Super User

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

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
Level: Powered On

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

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

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,796)