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 / OData Filter OR operat...
Power Automate
Unanswered

OData Filter OR operator not working with dates

(0) ShareShare
ReportReport
Posted on by 114

Am I missing something really simple?

Inside a flow, inside of Sharepoint Get Items action

This returns multiple items

 

DateComplete gt '@{outputs('Compose')}'

 

This returns multiple items

 

StaffChangeToCompleteDate gt '@{outputs('Compose')}'

 

This returns nothing

 

DateComplete gt '@{outputs('Compose')}' or StaffChangeToCompleteDate gt '@{outputs('Compose')}'

 

For context - here's where I'm using it.

Snag_2d5941ba.png

Categories:
  • SudeepGhatakNZ Profile Picture
    14,396 Most Valuable Professional on at

    @BenMunk ,

    Try comparing the dates in the same format using the formatDatetime function. The format you should use is yyyy-MM-dd.

    Like:

    DateComplete gt formatDateTime('@{outputs('Compose')}','yyyy-MM-dd')

     

  • BenMunk Profile Picture
    114 on at

    Thanks for you suggestion, but I seem to be getting a syntax error with that "The query is not valid."

  • BenMunk Profile Picture
    114 on at

    @SudeepGhatakNZ   I tried formatDateTime on the Compose action.  Syntax worked fine, but still same problem with the filter - each clause fine by itself, as soon as combine the clauses with the "or" operator, I get no results.

  • SudeepGhatakNZ Profile Picture
    14,396 Most Valuable Professional on at

    Can you upload a screenshot?

  • BenMunk Profile Picture
    114 on at

    First screenshot shows setup and output with "or" operator - no results.  Second screenshot shows same thing without the "or" statement - multiple results.

     

    Snag_2dca25ef.png

     

    Snag_2dd07980.png

  • BenMunk Profile Picture
    114 on at

    Its possible that its a bug.  

    It seems I can run 

    • Date type column filter by itself (eg. 'date' gt 'yyyy-MM-dd') - works fine
    • OR operator with 2 Non-date types (eg. 'id' eq 'x' or 'status' eq 'y') - works fine 
    • OR operator with mix of Non-date type and Date type (eg. 'id' eq 'x' or 'date' gt 'yyyy-MM-dd') - disregards the date filter - only returns (id = x)
    • OR operator with 2 Date types (eg. 'dateA' gt 'yyyy-MM-dd' or 'dateB' gt 'yyyy-MM-dd' ) - returns nothing.
  • SudeepGhatakNZ Profile Picture
    14,396 Most Valuable Professional on at

    Interesting! I will have to try that out. I use Or all the time. Can't find an example where two dates are involved.

     

  • BenMunk Profile Picture
    114 on at

    Would be interested to hear if its happening for you.  In the end I had to use non-date columns to achieve my needs.  If it is a bug hopefully its rectified soon.

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
Mohsin Ali Profile Picture

Mohsin Ali 430

#2
11manish Profile Picture

11manish 341 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 282

Last 30 days Overall leaderboard