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 / First 100 character of...
Power Automate
Unanswered

First 100 character of a string

(0) ShareShare
ReportReport
Posted on by 91

I have a variable which I would like to restrict to the first 100 characters. How would I include this as an expression in my flow?

Categories:
I have the same question (0)
  • Expiscornovus Profile Picture
    33,189 Most Valuable Professional on at

    Hi @tpitman,

     

    That would be something like below.

    substring('<text>', <startIndex>, <length>)

     

    In your case:

    substring(outputs('Compose'), 0, 100)

     

    Below is an example in a Compose

    expression_substring.png

     

    You can also use the substring action instead.

     

    substringaction.png

  • tpitman Profile Picture
    91 on at

    Thank you very Much!!

  • VictorIvanidze Profile Picture
    13,073 on at

    I think this is better:

    if(greater(length(outputs('Compose')),100),substring(outputs('Compose'), 0, 100),outputs('Compose'))
  • Expiscornovus Profile Picture
    33,189 Most Valuable Professional on at

    Hi @VictorIvanidze,


    Yes, I totally agree. It is definitely good practice to check if the value actually is greater than 100 characters before using the substring function 👍

     

    I just wanted to start simple, by first explaining the substring function. I assumed this was going to be a follow-up question after my first reply and I would have explained the length and greater functions than. I was aiming for the step-by-step explanation approach 😁

     

  • tpitman Profile Picture
    91 on at

    Thank you both.

     

    The text is ALWAYS going to be  > 100 so it should be fine 🙂

  • tpitman Profile Picture
    91 on at

    out of interest, if I wanted to extract a string with characters 5-8, would it be as simple as "Starting position" 5, length 3

    Using the substring action of course

  • VictorIvanidze Profile Picture
    13,073 on at

    Try it!

     

  • tpitman Profile Picture
    91 on at

    Yep! that works!! 🙂

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