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

Community site session details

Session Id : dG6dr9fqhdnkNUB6Bs1FCq
Power Automate - Using Flows
Unanswered

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

Like (0) ShareShare
ReportReport
Posted on 20 Jan 2023 14:20:45 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,934 Super User 2025 Season 2 on 26 Jan 2023 at 15:30:08
    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 26 Jan 2023 at 14:56:26
    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,934 Super User 2025 Season 2 on 23 Jan 2023 at 16:31:27
    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

Telen Wang – Community Spotlight

We are honored to recognize Telen Wang as our August 2025 Community…

Announcing our 2025 Season 2 Super Users!

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Tomac Profile Picture

Tomac 986 Moderator

#2
stampcoin Profile Picture

stampcoin 699 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 577 Super User 2025 Season 2

Featured topics

Restore a deleted flow
Loading complete