Skip to main content

Notifications

Power Automate - General Discussion
Answered

Substring outputs - first characters

(0) ShareShare
ReportReport
Posted on by 4
Hi. (noob alert)

I'm working on a flow moving data from a Microsoft Form via Excel to Planner Tasks.

One challenge is that the form does not have a specific "Title" field. I want to fill the title of the task with the first 30 characters from available dynamic content.
 
When using this expression:  substring(outputs('description'),0,30)
I get the firt 30 characters as the title. But in the case there was less than 30 characters available the flow does not work.

How does a working expression look like?
I'd like to populate the "Title" field in Planner with any text available, but not more than 30 characters
Categories:
  • Chriddle Profile Picture
    Chriddle 7,371 on at
    Substring outputs - first characters
    Check function slice()
     If endIndex isn't specified or greater than the string length, search up to the end of the string.
  • NA-24101339-0 Profile Picture
    NA-24101339-0 4 on at
    Substring outputs - first characters
    Now, how about that!

    Silky and buttery smooth. Thank you so much, David MA.
  • Verified answer
    David_MA Profile Picture
    David_MA 9,039 on at
    Substring outputs - first characters
    Try using this expression instead: if(lessOrEquals(length(outputs('description')), 29), outputs('description'), substring(outputs('description'), 0, 30))

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,636

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,942

Leaderboard