Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Unanswered

Loop reference from within same loop not possible error

(1) ShareShare
ReportReport
Posted on by 250

So I have an Until loop and the input is defined as a dereferencing of an array element, array which is initialized and set before (so outside) the loop. In other words, to make sure that the Until loop checks the condition against each element of the array as it iterates over the array, I set the input to the loop like so:

 

variables('email_body_lines')[iterationIndexes('LOOP10::over_oor_section_until_start_of_spf_section')]

 

iso_0-1606526544327.png

However, I get the following error message:

 

InvalidTemplate. Unable to process template language expressions for action 'LOOP10::over_oor_section_until_start_of_spf_section' at line '1' and column '12373': 'Template language expression cannot be evaluated: the template action 'LOOP10::over_oor_section_until_start_of_spf_section' is not defined at current scope.'.

 

Why? Why can't I reference the loop by name within itself?  How can such a reference not be defined at current scope? For crying out loud, we are inside the loop scope!

  • schwibach Profile Picture
    Super User 2025 Season 1 on at
    Re: Loop reference from within same loop not possible error

    I have the same issue.

  • Pritesh Profile Picture
    6 on at
    Re: Loop reference from within same loop not possible error

    Why can't someone reply to this? I'm having same issue.

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1