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 / Template language expr...
Power Automate
Unanswered

Template language expression cannot be evaluated because array index '8' is outside bounds (0, 7) of array

(0) ShareShare
ReportReport
Posted on by 112

I get a flow fail on me with the below error:

 

"Unable to process template language expressions in action 'Extract_Base_office_VALUE' inputs at line '0' and column '0': 'The template language expression 'last(split(outputs('Split_body_text_and_parse_to_array')[8],': '))' cannot be evaluated because array index '8' is outside bounds (0, 7) of array. Please see https://aka.ms/logicexpressions for usage details.'."

 

I'm not sure what this means or why it is failing. The outputs are as follows:

 

[
 "First name: John",
 "Last Name: Doe",
 "Cost center:",
 "Commission: [\"IDO\"]",
 "Base Office: Plymouth ",
 "Commission Director Email:",
 "Sponsor Email: [\"IDO\"]",
 "End user global email: firstname.lastname@domain.co.uk"
]

 

And then the card where it fails is coded as follows:

 

last(split(outputs('Split_body_text_and_parse_to_array')[8],': '))

 

Does an array only have 7 'columns' or buckets?

Categories:
I have the same question (0)
  • Expiscornovus Profile Picture
    33,189 Most Valuable Professional on at

    Hi @elfreddos,

     

    Index 0 is item 1, index 1 is item 2, etc.

     

    In this case if you want to split the content of the 8th item (end user global email property) you would want to use an index [7].

     

    Try:

    last(split(outputs('Split_body_text_and_parse_to_array')[7],': '))

     

  • SanmeshG Profile Picture
    1,947 Moderator on at

    Hi @elfreddos  ,

     

    The array has 8 elements but the index of the array starts from 0 . In the above example you can read values from 0 to 7. So change your expression as below to get the value.

    last(split(outputs('Split_body_text_and_parse_to_array')[7],': '))

    If this helps please accept it has a solution.

     

    Thanks,

     

  • ManishSolanki Profile Picture
    15,091 Super User 2025 Season 2 on at

    Hi @elfreddos 

     

    If you are looking for getting the value of 8th element, then pls try the below expression:

    last(split(outputs('Split_body_text_and_parse_to_array')[7],': '))

     Array index starts with 0 so to get value 8th element, we need to fetch 7th indexed element.

     

    If we are not sure about array length but it is fixed that last element will contains the required data, then you could use the below expression:

    last(split(outputs('Split_body_text_and_parse_to_array')[sub(length(outputs('Split_body_text_and_parse_to_array')),1)],': '))

    The above expression will always work on the last element irrespective of the length of an array.

     

    If this helps, please remember to give a 👍 and accept my solution as it will help others in the future.

     

    Thanks

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

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard