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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Filter query for tasks...
Power Automate
Answered

Filter query for tasks coming due in next 15 days

(0) ShareShare
ReportReport
Posted on by

Hi,

 

I am working on a flow which sends a consolidated report out listing all tasks (its working already). The flow will run every monday, so the idea is to send just the tasks in one email to a user that are due in next 15 days not all the tasks. So I need help on putting in correct filter query formula under get items action, if someone can help, would appreciate.

 

thanks in advance. 

Categories:
I have the same question (0)
  • AlanPs1 Profile Picture
    2,471 on at

    Hi @Anonymous 

    I would advise using "Get Items", then normally I just use "Filter Array" and use WDL to construct an expresion that filters as you want it to. See below:Capture-160.png

    In this example it will only return those with created date that is 15 days ago, all others older and newer dates will be filtered out. You can change the drop down to suit and change the expression to suit. Depending on how you construct the expression will depend on the options you choose in the dropdown, ie, equal to, not equal too. Maybe less that or equal to, greater or equal to. You get the idea I am sure.

     

    Here is a useful link - Functions reference for Workflow Definition Language in Azure Logic Apps

    You will find utcNow(), formatDateTime() etc all on there and you should be able to acheive the filter you require.

     

    There are lots of posts that deal with expressions out there you will find in the forum but once you're further on and if you were to get stuck just post back.

     

    If you have found my post helpful, please mark thumbs up.

    Thanks, Alan

  • Community Power Platform Member Profile Picture
    on at

    @AlanPs1  thanks. Is there no way to achive this just via filter query? Adding condition would complicate things for me so really looking for a filter query here.

  • AlanPs1 Profile Picture
    2,471 on at

    Hi @Anonymous .

    Yes, there is and here is the reference I use when working with Odata filters.

    Use query parameters to customize responses

    Flow guides on the following format:

    stringColumn eq 'string' OR numberColumn lt 123

    so based on your paramaters:

    dueDate ge '2019-02-20T08:00' and le '2017-03-06T17:00'

    You will then need to consider creating some variables to handle the current day and 15 days from now but basically, this is how it is done. You will also need to consider date/time format and the likes too.

    For me, I prefer the "Filter Array" and can acheive the same type of thing but above is what you are looking for.

     

    Thanks, Alan

     

  • Verified answer
    ScottShearer Profile Picture
    25,277 Most Valuable Professional on at

    @Anonymous and @AlanPs1 :

     

    If I understand the issue correctly, the goal is to limit the number of items to just those dues within the next 15 days.  If that is the case, you are better off using an OData filter in the Get Items action.  The filter can be constructed so that only items due within the next 15 days are returned.  No need to filter item after that.

     

    Please note that you need to use SharePoint internal column names in the OData filter and not the display name - they may not be the same.  If you have spaces in the name, they will definitely be different.

     

    The Get Items configuration would look like this:

    DateFilter.jpg

     

    If this addresses your issue, plase mark your post as Solved.

     

    Scott

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
trice602 Profile Picture

trice602 398 Super User 2025 Season 2

#2
David_MA Profile Picture

David_MA 323 Super User 2025 Season 2

#3
Expiscornovus Profile Picture

Expiscornovus 183 Most Valuable Professional

Last 30 days Overall leaderboard