Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Unanswered

Error code when trying to save my work.

(1) ShareShare
ReportReport
Posted on by 3

Trying to save a flow I have spent 10 hours working on, and this is the error code I keep getting? I really need to save my work unless I will lose it all! The flow checker tells me there are no errors, however this is the code I get when I attempt to save my work!

 

Flow save failed with code 'InvalidTemplate' and message 'The template validation failed: 'The inputs of template action 'Condition_1' at line '1 and column '5839' is invalid. Action 'Apply_to_each' must be a parent 'foreach' scope of action 'Condition_1' to be referenced by 'repeatItems' or 'items' functions.'.'.

 

Here is a SS of condition 1 in my flow:

S4MWEL_0-1720801639357.png

 Thank you in advance!

  • ManishSolanki Profile Picture
    15,085 Super User 2025 Season 1 on at
    Re: Error code when trying to save my work.

    I meant to say that just reselect the columns from dynamic content window in condition action for middle & right branch. When you reselect the columns those will be from the output of "Apply to each 1" & "Apply to each 2" action. This way references of original "Apply to each" output have been removed from both branches.

     

     

     

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

     

  • S4MWEL Profile Picture
    3 on at
    Re: Error code when trying to save my work.

    Does this mean I need to remove all copy and pasted conditions and do them again manually? What do you mean by 

     

    "modify the condition actions for middle & right side branch to include output property from respective "Apply to each" action"

     

    Sorry I am brand new to Automate but thank you so much for helping!

  • ManishSolanki Profile Picture
    15,085 Super User 2025 Season 1 on at
    Re: Error code when trying to save my work.

    Hi @S4MWEL 

     

    It looks like you had copied left branch & pasted it to create middle & right side branch. Post copying the name of the action "Apply to each" has been changed for middle & right branches (Apply to each 1 & Apply to each 2). You need to modify condition actions for middle & right side branch to include output property from respective "Apply to each" action as those are still referring original 'Apply to each' action.

     

     

     

     

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

     

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

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May 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 566 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 516 Super User 2025 Season 1

#3
stampcoin Profile Picture

stampcoin 492