cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
dmistry
Level 8

Unable to send Flow Email out if SharePoint task Due Date is in the past and not completed

Hi,

 

I am working with SharePoint task list and trying to build flow for the same. Basically if a task Due Date is less than or equal to today and if its not marked as completed then send an email out to the user to whom the task is assigned. Below is the task list screenshot.

taskList.JPG

So to overcome that I am using below condition formula: in flow.

 

@AND(lessOrEquals(formatDateTime(item()?['DueDate'], 'MM/dd/yyyy'),
formatDateTime(addDays(utcNow(), 0), 'MM/dd/yyyy')),equals(items('Apply_to_each')?['Checkmark'], 0))

 

Below is the flow screenshot as well:

 

Capture.JPG

The Flow runs successfully but the condition evaluates to false. As per the Task list screenshot, I have two overdue tasks, out of which Finance Report task is completed but Accounting report is not. So based on the condition and flow formula, it should have notified me for "Accounting report" task since its due date is in past and completed (checkmark) is also 0. Can someone help me correct this, might be making a  minor mistake here.

 

Thanks in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
dmistry
Level 8

Re: Unable to send Flow Email out if SharePoint task Due Date is in the past and not completed

After spedning some time and doing some reaserch, I finally figured out.

I had to basically use the Task Status Value label to check its not completed.

First condition used is as follows: @not(equals(items('Apply_to_each')?['Status']?['Value'], 'Completed'))

 

Second Condition I added was: @lessOrEquals(formatDateTime(item()?['DueDate'], 'MM/dd/yyyy'),
formatDateTime(addDays(utcNow(), 0), 'MM/dd/yyyy'))

 

Flow screenshots below, hopefully it will help someone.

Flow1.JPGFlow2.JPG

2 REPLIES 2
bonm014
Level: Powered On

Re: Unable to send Flow Email out if SharePoint task Due Date is in the past and not completed

Try to debug your condition to see which one fails.

Create 3 variables where you will store your result of each on of your AND statement, then you will see which one fails or contains the value.

Then you have your variables and the condition can then be changed to use the variables, this will also make your flow more readable

dmistry
Level 8

Re: Unable to send Flow Email out if SharePoint task Due Date is in the past and not completed

After spedning some time and doing some reaserch, I finally figured out.

I had to basically use the Task Status Value label to check its not completed.

First condition used is as follows: @not(equals(items('Apply_to_each')?['Status']?['Value'], 'Completed'))

 

Second Condition I added was: @lessOrEquals(formatDateTime(item()?['DueDate'], 'MM/dd/yyyy'),
formatDateTime(addDays(utcNow(), 0), 'MM/dd/yyyy'))

 

Flow screenshots below, hopefully it will help someone.

Flow1.JPGFlow2.JPG

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020

thirdimage

Flow Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 109 members 4,700 guests
Please welcome our newest community members: