web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Use of If in substring...
Power Automate
Answered

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

(0) ShareShare
ReportReport
Posted on by 12

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

Categories:
I have the same question (0)
  • Verified answer
    Pstork1 Profile Picture
    68,717 Most Valuable Professional on at

    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'))
  • viveka Profile Picture
    12 on at

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

  • WHSBPjM Profile Picture
    59 on at

    @Pstork1 

     

    I have a similar issue where I have 3 types of strings being passed. Do I still use the Greater than function for this scenario where I only want to pull/return the numeric portion of the string?

    ABC12345 = 12345

    XY56789 = 56789

    01234 = 01234 

     

  • Pstork1 Profile Picture
    68,717 Most Valuable Professional on at

    Please post this as a new question.  You'll get more responses that way and others will be able to find the answer.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard