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 / The template language ...
Power Automate
Answered

The template language function 'substring' parameters are out of range: 'start index' and 'length' must be non-negative integers and their sum must be no larger than the length of the string

(0) ShareShare
ReportReport
Posted on by 3,514

I have the Store_x0023_ values = something as follow 123;#112 .. where i want to get the charterers after the "#".. so 112 on my case

 

Where i tried this formula:-

substring(triggerOutputs()?['body/Store_x0023_'],add(lastIndexOf(triggerOutputs()?['body/Store_x0023_'],'#'),1),sub(length(triggerOutputs()?['body/Store_x0023_']),lastIndexOf(triggerOutputs()?['body/Store_x0023_'],'#')))

 

But i will get this error:-

 

Unable to process template language expressions in action 'Create_item' inputs at line '0' and column '0': 'The template language function 'substring' parameters are out of range: 'start index' and 'length' must be non-negative integers and their sum must be no larger than the length of the string. Please see https://aka.ms/logicexpressions#substring for usage details.'.

 

Categories:
I have the same question (0)
  • Verified answer
    Rhiassuring Profile Picture
    8,692 Moderator on at

    Hi there, 

    I was able to get it using this:  

     
    substring(variables('txtHashtag'),add(indexOf(variables('txtHashtag'),'#'),1))

     

    Rhiassuring_0-1649029228851.png

    For you this would be, 

    substring(triggerOutputs()?['body/Store_x0023_'],add(indexOf(triggerOutputs()?['body/Store_x0023_'],'#'),1))

     

    Can you try that out and let me know if it fits your needs?

    Cheers,


    Rhia

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 376

#2
Valantis Profile Picture

Valantis 361

#3
David_MA Profile Picture

David_MA 294 Super User 2026 Season 1

Last 30 days Overall leaderboard