cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Magnifica
Helper I
Helper I

Condition if Status A or B AND from Created passed X days

Hello,

 

I cant get the condition correctly, so that my flow checks if the Status is 'New' OR 'in Process AND 30 days passed from the Created Date.

 

@and(
    equals(items('Apply_to_each')?['Status'], 'New'), 
or( equals(items('Apply_to_each')?['Status'], 'in Process')
), equals(items('Apply_to_each')?['Created'], formatDateTime(adddays(utcnow(),-30),’yyyy-MM-dd’))
)

 

2 REPLIES 2
v-xida-msft
Community Support
Community Support

Hi @Magnifica,

 

Could you achieve your needs with the formula that you provided?

Could you please share a screenshot of your flow's configuration?

 

I think there is something wrong with the formula that you provided, please take a try with the following formula:

@and(or(equals(items('Apply_to_each')?['Status'], 'New'), equals(items('Apply_to_each')?['Status'], 'in Process')), equals(formatDateTime(items('Apply_to_each')?['Created'], 'yyyy-MM-dd'), formatDateTime(addDays(utcNow(), -30), 'yyyy-MM-dd')))

More details about the expressions within Microsoft Flow, please check the following article:

https://docs.microsoft.com/en-us/azure/logic-apps/logic-apps-workflow-definition-language

 

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hallo Kris,

 

thank you for the correction of my code! That doesnt give me any errors.

But i Still cant get a true condition! Whatever Value i give i still get fals result.

 

Do you know why this happens?

 

Bildschirmfoto 2018-04-19 um 13.33.09.png

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (2,404)