cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
techiecraig1
Regular Visitor

Closing Leads after x weeks of no activity.

Hello, I work in a company that deals with a large amount of leads on dynamics 365. I am looking to have a flow run every midnight that removes any lead/opportunity that is older than x amount of weeks. Can anyone help please?

 

techiecraig1_0-1624288950214.png

techiecraig1_1-1624288977772.png

 

When checking the flow it appears that every entry is coming up 'false' on the condition. I can't work out whether it's the first 'date' condition or the 'Status' condition.

 

Please help! 

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Expiscornovus
Super User II
Super User II

Hi @techiecraig1,

 

Open is the label of the option. Can you replace the value Open by the value 0 (which corresponds with the status Open).

 

statusequal0.png

 

Alternatively you can also use the label in your condition by using this expression:

items('Apply_to_each')?['statecode@OData.Community.Display.V1.FormattedValue']

 

formattedvalue_condition.png

View solution in original post

2 REPLIES 2
Expiscornovus
Super User II
Super User II

Hi @techiecraig1,

 

Open is the label of the option. Can you replace the value Open by the value 0 (which corresponds with the status Open).

 

statusequal0.png

 

Alternatively you can also use the label in your condition by using this expression:

items('Apply_to_each')?['statecode@OData.Community.Display.V1.FormattedValue']

 

formattedvalue_condition.png

View solution in original post

Ah that worked! Thank you very much.

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

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.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Top Solution Authors
Users online (2,836)