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

Send an email daily based on conditions around SharePoint list

Hi, I hope someone can help me with this.

I have a SharePoint list that the Flow is pulling from, one column is a 'Task status' that has three choices to choose from:

  • Not started
  • In Progress
  • Completed

There is also a 'Due date' column.

I am trying to create a flow that will look across all list items taking a look specifically at the 'Due date' and determine that if this is in 21 days time it has met a condition and if the 'Task status' choice 'does not contain' 'Completed' then an email will be sent.

 

I can get it to send an email without the time being looked at, and i can do the reverse of that however what i am struggling with is applying 2 conditions as the time one seems to be ignored every time and although the email is being sent Flow is telling me it has failed.

 

Expressions are:

formatDateTime(items('Apply_to_each')?['dateDueTime'],'yyyy-MM-dd')
addDays(utcNow(),21,'yyyy-MM-dd')

choices.JPG

Any help will be gratefully received.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Helper I
Helper I

Re: Send an email daily based on conditions around SharePoint list

@abm i tried this and all results are false which i would expect as all the fields are filled in.

 

However from the information both @abm  and @yashag2255  gave me i managed to solve it by looking closer at the expressions and ensuring the SP list was complete.

All Taskl.Status are now filled in and the formatdate...expression has been amended to show ['Due Date' to reflect the name on the list.

 

Thank you both.

View solution in original post

14 REPLIES 14
Highlighted
Super User III
Super User III

Re: Send an email daily based on conditions around SharePoint list

Hi @AnnaJordan 

 

Could you please post your format and add expression you are using under the IF condition?

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog

Power Automate Video Tutorials
Highlighted
Helper I
Helper I

Re: Send an email daily based on conditions around SharePoint list

@abm  I have now added the requested expressions.

 

Many thanks

Highlighted
Super User III
Super User III

Re: Send an email daily based on conditions around SharePoint list

Hi @AnnaJordan 

 

Thanks for your quick reply. Which condition is getting passed every time? Your expressions looks good to me.



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog

Power Automate Video Tutorials
Highlighted
Dual Super User III
Dual Super User III

Re: Send an email daily based on conditions around SharePoint list

Hi @AnnaJordan 

 

Can you try replacing the Task Status from the first condition box to Task Status Value and select the operand as Equal To and try again? Ensure that there are no white spaces after the text on the right side box of the condition. 

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Highlighted
Helper I
Helper I

Re: Send an email daily based on conditions around SharePoint list

@yashag2255 - thank you for you response.

 

The first condition box is 'Task.Status.value.  If i change the operand to 'equal to' wouldn't I need to add another condition to account for both 'Not started' & 'In Progress'?

Highlighted
Helper I
Helper I

Re: Send an email daily based on conditions around SharePoint list

@abm Thank you for the response.

 

When both conditions are present the formatdate... expression is being passed...

Highlighted
Dual Super User III
Dual Super User III

Re: Send an email daily based on conditions around SharePoint list

Hi @AnnaJordan 

 

The task.status.value is just a string. So it will always be a single value of the three. In this case you just want to check if it was completed or not and therefore you can change the operand that way. Can you make a try by changing the operand and see if you continue to face the same issue? 

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Highlighted
Helper I
Helper I

Re: Send an email daily based on conditions around SharePoint list

@yashag2255 I changed the operand to 'equal to' and the run failed as below:

failed run.JPG

Highlighted
Dual Super User III
Dual Super User III

Re: Send an email daily based on conditions around SharePoint list

Hi @AnnaJordan 

 

Can you share a screenshot of the action on which the flow has failed? This screenshot shows that the condition was not satisfied. You might want to click on the 'Next Failed' in the apply to each loop to navigate to the iteration that has a failed action. 

 

Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Highlighted
Helper I
Helper I

Re: Send an email daily based on conditions around SharePoint list

@yashag2255 is this what you mean?  failed run.JPG

Highlighted
Dual Super User III
Dual Super User III

Re: Send an email daily based on conditions around SharePoint list

Hi @AnnaJordan 

 

Yes. This shows that in the SP list, some items do not have any value in the Due Time column. Can you check and update your data so that every item has that column filled and run the flow again? 

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Highlighted
Super User III
Super User III

Re: Send an email daily based on conditions around SharePoint list

Hi @AnnaJordan 

 

If you don't have Due Date value at this stage then you could check null.

 

See below I have a list called ajlist and a column called 'StartDate type as DateTime.

 

image.png

 

Here is my list

 

image.png

 

Here is my flow checking Start Date is null?

 

image.png

 

Here is my run result

 

image.png

 

 


Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog

Power Automate Video Tutorials
Highlighted
Helper I
Helper I

Re: Send an email daily based on conditions around SharePoint list

@abm i tried this and all results are false which i would expect as all the fields are filled in.

 

However from the information both @abm  and @yashag2255  gave me i managed to solve it by looking closer at the expressions and ensuring the SP list was complete.

All Taskl.Status are now filled in and the formatdate...expression has been amended to show ['Due Date' to reflect the name on the list.

 

Thank you both.

View solution in original post

Highlighted
Super User III
Super User III

Re: Send an email daily based on conditions around SharePoint list

Hi @AnnaJordan 

 

Glad to hear that you have resolved it. I was giving you another option that if you want to eliminate where due dates are not ready but looks like you are expecting all the values  before flow gets processed. Thanks for the update.

 



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog

Power Automate Video Tutorials

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Upcoming Events

Experience what’s next for Power Automate

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Top Solution Authors
Top Kudoed Authors
Users online (3,249)