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 / Can I get index number...
Power Automate
Unanswered

Can I get index number in apply to each?

(0) ShareShare
ReportReport
Posted on by

Hi,

      How can I get show no in action "Apply to each".

      I want to get no for send loop email such as.

            No. 1 is xxxxxxxxxx

            No. 2 is yyyyyyy

Thanks in advance.

Aor.

 

error_10.png

 

Categories:
I have the same question (2)
  • Verified answer
    v-alzhan-msft Profile Picture
    on at

    Hi @Anonymous ,

     

    Please refer to screenshot below to create the flow:

    1.png

     

    Best regards,

    Alice       

     

    Community Support Team _ Alice Zhang
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • Community Power Platform Member Profile Picture
    on at

    Hi,

            Solution is create outside variable and it can not get loop no in action "Apply to each".

    Thank you very much for your information.

    Aor

  • v-alzhan-msft Profile Picture
    on at

    Hi @Anonymous ,

     

    Have you take a try with the solution?

     

    Best regards,

    Alice       

     

    Community Support Team _ Alice Zhang
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • Community Power Platform Member Profile Picture
    on at

    Hi,

            This solution is working but I find out for other solution.

            Do you have any idea for get index no in loop not declare variable ?

    Thank you very much for your support.

    Aor.

     

  • v-alzhan-msft Profile Picture
    on at

    Hi @Anonymous ,

     

    There is no any other solution.

     

    Best regards,

    Alice       

     

    Community Support Team _ Alice Zhang
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • Community Power Platform Member Profile Picture
    on at

    Hi Alice,

            I accepted this solution.

           Thank you for your information.

    Aor.

  • Community Power Platform Member Profile Picture
    on at

    The suggested solution does not work inside an apply-to-each loop with concurrency set.  I can navigate through the index in the run log and see the data associated with each item, so the index should be possible!  When implementing the suggested solution the index count in the variable does not match the index of the run log.  The test I ran suggest it is randomly off the mark.

  • HEATFreight Profile Picture
    1,024 on at

    This really ought to be possible without a variable! For instance, iterationIndexes() works in a Do Until loop. Why can't that same thing work in an Apply to Each loop?

    Power Apps devs should fix this, as it's a sorely needed feature!

  • antc Profile Picture
    34 on at

    Here is a solution for concurrency

    https://sharepains.com/2022/08/17/avoid-variables-apply-to-each-power-automate/

     

  • HEATFreight Profile Picture
    1,024 on at

    Sorry to be blunt, but that tutorial sucks. It doesn't specify what the 'Apply to each' is operating on. What's the input to the loop? It's unclear how that solves the problem.

    Of course, if you add a unique integer ID to each element in an array, then you can use that as an index. That's an obvious workaround for iterationIndeces() not working in 'Apply to each' loops, but it's not without faults: namely that you must add unnecessary logic to the flow and that you must iterate through the entire list of data to assign unique integer IDs to each element.

    This may be prohibitively intensive, computationally, when working with large sets of data. But any additional delay in run time is undesirable.

    However, upon taking a second look, I believe I understand. The 'Apply to each' must be iterating on the 'IDs' array, rather than the original data in the 'Compose' array. This solution seems workable, assuming the range() function does not take a long time to count the length of the input array, and I'm guessing it's pretty fast because it's not really iterative like a single-concurrency 'Apply to each'. A normal workaround would involve preemptively adding ID integers to each element in the array with an iterative loop, but this solution only iterates once, and it can do so concurrently, because it's not iterating on the input data, but on the range() array, and selecting indices from the input data using the current value of the range() iteration.

    Pretty smart actually. Still think they could have done a better job of documenting it, because I doubt most folks will stare at that tutorial, scratching their head in confusion, long enough to understand the crucial missing piece of information: the input to the 'Apply to each'!

    Thanks @antc2 

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