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

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,506

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,690 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

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

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard