web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Weekly digest email of...
Power Automate
Answered

Weekly digest email of all Planner tasks due in the next 2 weeks

(0) ShareShare
ReportReport
Posted on by 6

I'm trying to create a flow based on this template: Send a digest email of all outstanding Planner tasks 

 

However, rather than listing all outstanding tasks, I'd like it to only list tasks due in the next 2 weeks.

 

Does anyone have any ideas?

Categories:
I have the same question (0)
  • v-bacao-msft Profile Picture
    Microsoft Employee on at

     

    Hi @CiaraPollen ,

     

    Please refer to the following expression to filter tasks:

    @and(not(equals(item()?['percentComplete'], int(100))), less(item()?['dueDateTime'], addDays(utcNow(), 14, 'yyyy-MM-dd')))

    163.PNG 

     

    Best Regards,

  • CiaraPollen Profile Picture
    6 on at

    @v-bacao-msft Thank you for the suggestion.

     

    This is very similar to a fix I already attempted, and returned the error below:

     

    InvalidTemplate

    The execution of template action 'Filter_array' failed: The evaluation of 'query' action 'where' expression '@and(not(equals(item()?['percentComplete'], int(100))), less(item()?['dueDateTime'], addDays(utcNow(), 14, 'yyyy-MM-dd')))' failed: 'The template language function 'less' expects two parameter of matching types. The function was invoked with values of type 'Null' and 'String' that do not match.'.

     

    I have seen another template which uses the term 'coalesce' rather than asking for a date 'less than' 14 days from now, but my coding skill is not good enough to understand why and how to resolve the above error!

  • Verified answer
    v-bacao-msft Profile Picture
    Microsoft Employee on at

     

    Hi @CiaraPollen ,

     

    Because you have not set due date for some tasks, this error will appear.

     

    You can first filter out tasks whose due date is not empty.

    168.PNG

     

    Best Regards,

  • johnnybirdman Profile Picture
    2 on at

    I was able to get the output I wanted with this solution, thank you!  A follow-up question:  my output now only shows the following 2 weeks, but the output is not in order by due date.  Any way to solve this?

  • trishmalloy Profile Picture
    415 on at

    @v-bacao-msft 

     

    Knowing how to sort ascending by due date would be most helpful. Are you able to help with this?

  • qopwer12 Profile Picture
    46 on at

    Hi everyone, new user here 

     

    When I put this into my filter array, 

     

    @And(not(equals(item()?['percentComplete'], int(100))), less(item()?['dueDateTime'], addDays(utcNow(), 14, 'yyyy-MM-dd')))

     

    This format does work for my build but when I run it, no tasks appear at all.

     

    Is it because I converted my HTML table to show Eastern Standard Time? 

     

    Also is there a way to sort the due date as previously asked by my fellow powerautomaters above?

     

    EDIT: The formula worked for me. Also the due dates came out in ascending order automatically 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 607

#2
Valantis Profile Picture

Valantis 456

#3
11manish Profile Picture

11manish 352

Last 30 days Overall leaderboard