Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Unanswered

InvalidTemplate. The length of substring can't be longer than '___' which is the length of the source string.

(0) ShareShare
ReportReport
Posted on by 3

I inherited a flow triggered by adding an event to an Outlook calendar. The flow parses the email and creates a new ics file that we use elsewhere. In most cases, it works as intended. However, for a few events, it fails on "Get URL"

NewBee_0-1674223903174.png

 

The only difference I can see is a switch that is triggered by the subject.

One that works looks like this: 

NewBee_2-1674224053609.png

 

One that fails looks like this:

NewBee_1-1674224024169.png

Any ideas on how to get this to work consistently?

  • Chriddle Profile Picture
    7,652 Super User 2025 Season 1 on at
    Re: InvalidTemplate. The length of substring can't be longer than '___' which is the length of the source string.

    Seems that you end index string ('If you need') does not exist.

  • NewBee Profile Picture
    3 on at
    Re: InvalidTemplate. The length of substring can't be longer than '___' which is the length of the source string.

    When I took a closer look at the flow, I noticed that the "Get URL End Index" was not showing up in my dynamic content. Is that what you were hinting at?

     

    What has me stymied is the flow works 90% of the time.

    • It cancels the flow when an incoming message doesn't meet the conditions set.
    • It triggers correctly for 13 of 15 meeting notice types.

    But for some reason, there are 2 instances where it gives an error message on "Get URL". When I look at "Get URL End Index", it gives a negative number on the failed flows. 

    NewBee_0-1674744645858.png

    On the successful flows, it gives a positive number.

    NewBee_1-1674744949773.png

     

     

  • Chriddle Profile Picture
    7,652 Super User 2025 Season 1 on at
    Re: InvalidTemplate. The length of substring can't be longer than '___' which is the length of the source string.

    substing expects parameters text, startIndex and length (not endIndex)

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,524 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,906 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow