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 / Flow save failed with ...
Power Automate
Unanswered

Flow save failed with code 'InvalidTemplate' and message 'The template validation failed

(0) ShareShare
ReportReport
Posted on by 207
Hi All ,
 
I want to remove the rows based on the joining date column in the excel file . Requirement is , IF joining date is greater than current month but same year then the rows should remove from the file and also IF joining date is greater than current year this rows also should remove .

For eg : If we have Joining date = 28/01/2025 and 12/09/2026 , then both the rows should remove.
but getting the below error when saving the flow .. also running long time for just 7k rows in the data source (Sample data). but original data would be more than 300k :(
How to overcome this error and performance for large datasets ?
 
 
 
or(
int(formatDateTime(items('Applytoeach')?['Joining Date'], 'yyyy')) > int(formatDateTime(utcNow(), 'yyyy')),

and(
int(formatDateTime(items('Applytoeach')?['Joining Date'], 'yyyy')) = int(formatDateTime(utcNow(), 'yyyy')),
int(formatDateTime(items('Applytoeach')?['Joining Date'], 'MM')) > int(formatDateTime(utcNow(), 'MM'))
)
)
Categories:
I have the same question (0)
  • Expiscornovus Profile Picture
    33,830 Most Valuable Professional on at
     
    Just to double check, in the code snippet (below the screenshot) you shared the items functions are using an action with the name 'Apply to each' (a space is replaced by a underscore btw), however in your screenshot that name is 'Applytoeach'.
     
    Have you updated the expressions after renaming the action? The name needs to be exactly the same.
  • DineshK_ Profile Picture
    207 on at
    @Expiscornovus Yes I have renamed the action name because i have created 2 more actions with same "Apply to each" .
    So that i have renamed 1st one and based on that i have updated the expression.
     
    Post that i have removed remaining apply to each actions.
    Now both action name and expression is same right ?
    What should i update in the expression?
  • DineshK_ Profile Picture
    207 on at
    @Expiscornovus Hey any clue pls ?
    Still stuck with this job .. 
  • Expiscornovus Profile Picture
    33,830 Most Valuable Professional on at
     
    That seems to be correct, and it is still complaining about the reference message when you try to save the flow?
     
    Otherwise try this approach.
    - Rename the apply to each
    - Remove your conditions with the expressions and add a simple condition like 1 is equal to 2 for example
    - Save the flow (this way we now for sure the Rename activity has been picked up)
    - Remove the 1 is equal to 2 condition and add the conditions back again to your Condition 3 action and save the flow again

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 March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 550

#2
Valantis Profile Picture

Valantis 390

#3
11manish Profile Picture

11manish 348

Last 30 days Overall leaderboard