Hi all,
As the title says, I am trying to notified the Assigned person, via email, when their planner task is within 7 days of the due date. (Due date being the date listed in the due date field of the planner task.) I started by using this template "Send reminder email for incomplete Planner tasks in a plan" but cannot figure out how to have the system check if a due date is within 7 days.
I think the rest of the template would apply after that to sending the email, but the template is looking at % complete and not due date.
Any help appreciated! Thanks.
Hi @RRamsay,
You could add another criteria in the condition action to check for the due date. You can use the dueDateTime field for that from Get Task action.
With an expression you can retrieve the date of the dueDateTime field and remove the time part of it. You can also use the utcNow and addDays functions to calculate which day is 7 days from now.
Below is an example of that approach.
In this example I am also checking if the dueDateTime is empty. If it is empty I am setting it to custom date (1600-01-01). The e-mail will only be sent if the due date is exactly 7 days from today.
if(empty(body('Get_a_task')?['dueDateTime']), '1600-01-01', formatdatetime(body('Get_a_task')?['dueDateTime'], 'yyyy-MM-dd'))
is equal to
formatdatetime(addDays(utcNow(),7), 'yyyy-MM-dd')
thank you! I will give this a go!
Hi @Expiscornovus ,
What would your function be if you wanted to run the email if the date is within 7 days and not exactly 7 days out?
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
At the monthly call, connect with other leaders and find out how community makes your experience even better.
User | Count |
---|---|
26 | |
25 | |
24 | |
23 | |
21 |
User | Count |
---|---|
61 | |
42 | |
40 | |
29 | |
24 |