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 Date ...
Power Automate
Unanswered

Filter Query for Date in Power Automate

(0) ShareShare
ReportReport
Posted on by 33

Hello all!

 

I have a sharepoint list, with date column. I want to create a flow where it filters the data based on current month and year. 

Sibangi_0-1683277262727.png

This is the way I am doing it now, but the  result is not what I need. 

Sibangi_1-1683277311251.png

It returns an excel with everything. For this particular sample I would only need 05/2023 but instead I got so much more. Any help would be so appreciated!

Categories:
I have the same question (0)
  • Djuuu Profile Picture
    65 on at

    Can you provide more context? How does the column in sharepoint look? Is it Date formatted?

  • Sibangi Profile Picture
    33 on at

    Thank you for getting back, yes the date column is date formatted in the sharepoint list. Currently, people are manually filtering the dates referring to the current month and year. This needs to be automated. So if there are entries with the following dates

    15/05/2023

    16/05/2023

    12/06/2023

    14/05/2024

     

    I would only need the rows with the highlighted dates. Does this help explain?

  • Djuuu Profile Picture
    65 on at

    Yes, thank you. So based on your informations, your flow ist currently this:

    Calibration_x0020_Months eq'Concat(utcNow('MM'))' which translates based on your information into this:

    15/05/2023 eq '05'

    Can you try to use this one here:

    year(Calibration_x0020_Months) eq year(utcNow()) and month(Calibration_x0020_Months) eq month(utcNow())

  • Sibangi Profile Picture
    33 on at

    I did try 

    Sibangi_1-1683285689040.png

     

    but it throws an error saying 'not a valid query' The column name for date is 'Due_x0020_Date'

  • Chriddle Profile Picture
    8,436 Super User 2025 Season 2 on at

    You probably want to check if:

    The Sharpoint date is greater or equal utcNow('yyyy-MM-01')

    and less than addToTime(utcNow('yyyy-MM-01'),1,'month')

  • Djuuu Profile Picture
    65 on at

    Can you try to add an additional step "Filter Array" and add this under custom:

     

    @And(
     equals(formatDateTime(item()?['modified'], 'yyyy'), formatDateTime(utcNow(), 'yyyy')),
     equals(formatDateTime(item()?['modified'], 'MM'), formatDateTime(utcNow(), 'MM'))
    )

     

    modified needs to be changed to your column....

     

    btw, i also thought about that it could be easier if you add addtional columns to your list if possible. 

  • Sibangi Profile Picture
    33 on at

    I tried the above. Ideally it should return 

    Sibangi_0-1683289852780.png

    All of these dates, but instead it is returning only the first one. 

    Sibangi_1-1683289934079.png

    I am attaching my flow snippet

    Sibangi_2-1683289982150.png

    Thank you for all the support, the list can be changed, but multiple departments are involved, hence the list remains untouched is the idea.

     

  • Djuuu Profile Picture
    65 on at

    Can you try this one instead?

     

    And sorry, i try to help as good as i can, but without the orginal table it is hard to try the solutions before posting 😄

     

    Djuuu_0-1683291023950.png

    Use 

    formatDateTime(item()?['Created'], 'MM/yyyy')
     
    on the left side with your column, and on the right side with utcnow
  • Sibangi Profile Picture
    33 on at

    Atleast you are trying to help me! Which is so great. 

     

    'on the left side with your column, and on the right side with utcnow' - I didnot understand, can you show me?

  • Verified answer
    Djuuu Profile Picture
    65 on at

    Djuuu_0-1683527954926.png

     

    Filter Array:
    1.:formatDateTime(item()?['Due_x0020_Date'], 'MM/yyyy')

    is equal to

    2.: formatDateTime(utcnow(), 'MM/yyyy')

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…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard