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 / Need help with choppin...
Power Automate
Unanswered

Need help with chopping a string down into a substring if it's greater than 255

(0) ShareShare
ReportReport
Posted on by 4

Hey team

 

I'm trying to run this pile of code through Microsoft Flow. Access to the MS Form is fine and access to the MS Team is fine.

Long story short, if a string is more than 255 characters in length, I need to cut the string down to 255, ignoring anything cut off.

If I tell the code to always chop down to less than 255 from a string that's already less than 255, it crashes and burns.

If I tell the code to run an IF statement, as below, MS Flow refuses the expression saying that it's invalid.

 

The general format *appears* correct to me and when I run it through my VBA debugger, it says that it's fine - before I have the Dynamic Content part put in.

 

Any help would be greatly appreciated.

 

=IF(LEN((outputs('Get_response_details')?['body/r235f9d3840324a4d835cc30c351163bf'])>255),(LEFT((outputs('Get_response_details')?['body/r235f9d3840324a4d835cc30c351163bf']),255)),(outputs('Get_response_details')?['body/r235f9d3840324a4d835cc30c351163bf']))

Categories:
I have the same question (1)
  • Ed Gonzales Profile Picture
    4,531 Most Valuable Professional on at

    @SadowSon 

    Hi there.

    So the functions in Power Automate use a slightly different syntax than Excel or other similar products.  You'll probably want to use a combination of Length(), Greater(), and maybe Substring() to accomplish this.  Check out the list of functions here, and see if any of those will work.

     

    Keep us posted.

    -Ed-

     

     

    If you liked this reply, please give it a thumbs up! If this reply has answered your question or resolved your challenge, please consider marking it as a Solution. This helps other users find it more easily via search.

  • Verified answer
    v-bacao-msft Profile Picture
    on at

     

    Hi @SadowSon ,

     

    Please refer to the follow expression:

     

    Suppose I store the output of outputs ('Get_response_details')? ['Body / r235f9d3840324a4d835cc30c351163bf']) in Compose.

     

    Then the expression I should use below should be:

    if(greater(length(outputs('Compose')),25),take(outputs('Compose'),25),outputs('Compose'))

    13.PNG

     

    Best Regards,

  • SadowSon Profile Picture
    4 on at

    Hey team

     

    Thank you very much, Barrys suggestion seems to have made it work.

     

    Thanks for the help.

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 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard