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

Announcements

News and Announcements icon
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,851 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,081 on at

    I think this is better:

    if(greater(length(outputs('Compose')),100),substring(outputs('Compose'), 0, 100),outputs('Compose'))
  • Expiscornovus Profile Picture
    33,851 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,081 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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 816

#2
Valantis Profile Picture

Valantis 603

#3
Haque Profile Picture

Haque 566

Last 30 days Overall leaderboard