Creating an expression for a condition in Apply to each, Power Automate

Kirsty J 0 Reputation points
2025-10-13T20:33:45.73+00:00

I am trying to create a flow that updates a status on a list. I have a column for status which is a choice of "Approved" or "Expired". The default entry is approved and I want it to update to expired when the previous column "approved Year" is 5 years past. So i.e. if approved year is 2019 it will update to expired when the flow is run. I have attached what I have and the condition I have added is lessOrEquals( formatDateTime( addToTime( coalesce(items('Apply_to_each')?['Approved_x0020_Year'], '2000-01-01T00:00:00Z'), 5, 'Year' ), 'yyyy-MM-ddTHH:mm:ssZ' ), formatDateTime(utcNow(), 'yyyy-MM-ddTHH:mm:ssZ') ) I don't know how to write the expression myself so this has been provided by chat GPT.

Microsoft 365 Insider | Other
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Gérard Oomens 111.5K Reputation points Volunteer Moderator
    2025-10-13T21:27:24.5366667+00:00

    Post/ask in a Power Automate forum:

    https://community.powerplatform.com/


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.