web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Error code when trying...
Power Automate
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!

Categories:
I have the same question (0)
  • Manish Solanki Profile Picture
    15,169 Moderator on at

    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.

     

  • S4MWEL Profile Picture
    3 on at

    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!

  • Manish Solanki Profile Picture
    15,169 Moderator on at

    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.

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 862

#2
Valantis Profile Picture

Valantis 738

#3
Haque Profile Picture

Haque 553

Last 30 days Overall leaderboard