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 : I+qdEuhAURm36xVbIEqBCB
Power Automate - Building Flows
Answered

Array elements can only be selected using an integer index.

Like (0) ShareShare
ReportReport
Posted on 19 May 2023 11:30:19 by 33

Unable to process template language expressions in action 'Compose_2' inputs at line '0' and column '0': 'The template language expression 'length(outputs('Get_items')?['body/value'])' cannot be evaluated because property 'body/value' cannot be selected. Array elements can only be selected using an integer index.

 

I am trying to get the length of an Array from from apply each loop: length(outputs('Get_items')?['body/value'])

abeyenen72_0-1684495791242.png

 

 

Any help please

I have the same question (0)
  • abeyenen72 Profile Picture
    33 on 19 May 2023 at 12:31:15
    Re: Array elements can only be selected using an integer index.

    Thanks

  • Verified answer
    Sundeep_Malik Profile Picture
    6,484 on 19 May 2023 at 12:13:17
    Re: Array elements can only be selected using an integer index.

    Hey @abeyenen72 

    The error you are getting is because you have a loop(Apply_to_each_2) and then get items inside it.

    Because of this the get items is running twice.

    So the expression you are using outside doesnt know which iteration's length you need.

    So, you want the combined length of both the get items or separately.

     

    To get combined length:

     

    First initialize an integer variable.

    Then inside the apply to each use action increment variable. In that write the above expression.

     

    This will calculate length for all the iterations.

    Then outside you can use a compose and add the variable in it and it will show you the combined length of array:

    Sundeep_Malik_0-1684498194762.png

     

    Sundeep_Malik_1-1684498206263.png

    I hope this helps 🙂

     

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

MS.Ragavendar – Community Spotlight

We are honored to recognize Ragavendar Swaminatha Subramanian as our September…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 725 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 363 Moderator

#3
Power Apps 1919 Profile Picture

Power Apps 1919 341

Last 30 days Overall leaderboard
Loading complete