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 fails in Apply to...
Power Automate
Unanswered

Flow fails in Apply to each with Expresion Evaluation Failed error

(0) ShareShare
ReportReport
Posted on by 5,836 Moderator

I have a flow that will be comparing a date in a SharePoint list and more than 2 years old a status will be set in the item.

 

I have tried various solutions for evaluating the date, but I am getting this error:

 

The execution of template action 'Apply_to_each' failed: the result of the evaluation of 'foreach' expression '@items('Apply_to_each_2')?['ID']' is of type 'Integer'. The result must be a valid array.

 

 

The first formula in the conditon: 

formatDateTime(outputs('LastComplete'),'yyyy-mm-dd')
 
The second formula in the condition:
formatDateTime(addDays(utcNow(),-730),'yyyy-mm-dd')
 
Applytoeacherror.jpg

 

 

 

Categories:
I have the same question (0)
  • David_MA Profile Picture
    13,504 Super User 2026 Season 1 on at

    You need to use the format 'yyyy-MM-dd' with capitalized letter Ms. Lowercase mm returns the minutes value.

  • JR-BejeweledOne Profile Picture
    5,836 Moderator on at

    I made the change but am still getting the same error.

     

    DateFormula.jpg

     

     

  • David_MA Profile Picture
    13,504 Super User 2026 Season 1 on at

    I should have noticed this before. Is your LastComplete field a DateTime field? If so, you need to put that field in the first part of the condition without using an expression. It will automatically understand it is a date/time field and use the ISO8601 format and allow you to do a less than or equal to comparison. By using an expression, it treats it as a string, in which case you would only be able to use either is equal to or is not equal to in the condition.

     

  • JR-BejeweledOne Profile Picture
    5,836 Moderator on at

    Same problem. 

  • David_MA Profile Picture
    13,504 Super User 2026 Season 1 on at

    I am stumped then. Hopefully someone else has an idea for you. Good luck.

  • JR-BejeweledOne Profile Picture
    5,836 Moderator on at

    I think it has some thing to do with the fact that I am doing this in an Apply to each loop. 

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!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 58

#2
David_MA Profile Picture

David_MA 53 Super User 2026 Season 1

#3
Expiscornovus Profile Picture

Expiscornovus 36 Most Valuable Professional

Last 30 days Overall leaderboard