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 / Filter Planner Tasks t...
Power Automate
Answered

Filter Planner Tasks to show created or assinged since X time

(0) ShareShare
ReportReport
Posted on by 61

Hi all,

I am getting a list of all Planner Tasks, and I want to filter it to return only tasks where the Create Date/Time is after (i.e. greater than) X time or where the Assigned Date/Time is after (i.e. greater than) X time.

X time is the step "Get past time".

EricSara77_0-1673477810074.png

 

 

I am having issues creating an expression in the Filter array that can do both of the above.

  1. Create Date/Time is after (i.e. greater than) X time
  2. Assigned Date/Time is after (i.e. greater than) X time

EricSara77_1-1673478025621.png

I would love some help.

Cheers, 

 

Categories:
  • Expiscornovus Profile Picture
    34,005 Most Valuable Professional on at

    Hi @EricSara77,

     

    The value assignments (_assignments property) is an array an can have multiple assignees in it.

     

    However, maybe you might get away with checking the assignedDateTime of the first person in that array.

     

    Try something like below in the filter array

    @and(greater(item()?['createdDateTime'], body('Get_past_time')), greater(item()?['_assignments'][0]['value']['assignedDateTime'], body('Get_past_time')))

     

  • EricSara77 Profile Picture
    61 on at

    Hi @Expiscornovus,

    Thanks for the assist. I have been on leave but am now back, keen to get this to work. 

    I added your suggestion here (I think this is the right place).

    EricSara77_0-1675046956063.png

    But got this error

    nvalidTemplate. The execution of template action 'Filter_array_2' failed: The evaluation of 'query' action 'where' expression '@and(greater(item()?['createdDateTime'], body('Get_past_time')), greater(item()?['_assignments'][0]['value']['assignedDateTime'], body('Get_past_time')))' failed: 'The template language function 'greater' expects two parameter of matching types. The function was invoked with values of type 'Null' and 'String' that do not match.'.

     

    EricSara77_2-1675047106606.png

    Any help additional help on this would be appreciated. 

    Cheers,

  • Expiscornovus Profile Picture
    34,005 Most Valuable Professional on at

    Hi @EricSara77,

     

    Do you have any tasks which don't have any people assigned at all? In that case we might need to update the expression to exclude these tasks from the filter.

     

    Try something like below instead

    @and(and(greater(item()?['createdDateTime'], body('Get_past_time')), greater(length(item()?['_assignments']), 0)), greater(item()?['_assignments'][0]['value']['assignedDateTime'], body('Get_past_time')))

     

    Btw, I used it in Filter Array directly of the Lists Tasks action.

     

    filterarray_checkempty.png 

  • EricSara77 Profile Picture
    61 on at

    @Expiscornovus 

    Thanks for this. It looks to be working, but I think it is looking at the createdDateTime and I would like it to work off the assignedDateTime.  Given this is at a different level in the JSON code (I am sure that is not the right term to use) I am not sure how to do this. Once again, your help is appreciated. 

  • Verified answer
    Expiscornovus Profile Picture
    34,005 Most Valuable Professional on at

    Hi @EricSara77,

     

    Apologies if it wasn't clear.

     

    But the expression I shared earlier uses both the createdDateTime and the assignedDateTime of the first assigned person 😀

     

    timestamps_both.png

  • EricSara77 Profile Picture
    61 on at

    @Expiscornovus - Thanks so much for your help.  Very much appreciated. 

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 321 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 271

#3
Henil Profile Picture

Henil 115

Last 30 days Overall leaderboard