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 / Get items - Filter que...
Power Automate
Suggested Answer

Get items - Filter query using OR not working

(0) ShareShare
ReportReport
Posted on by 104
Hi.
I am trying to add multiple conditions to a Filter query i tried so many different combinations (using parenthesis, using or, using and etc) but i cannot make it to work
We have a number of Site Pages (we use them for IT Knowledge base articles) and the page properties are used for filtering, notifying etc, the columns names are Reviewed By, Review Date, Approved by, Approval Date, Document type, ref number, System.
The notification i want to create is a scheduled one (to go through the document library every Monday morning and check if there are any empty fields in the above mentioned columns)
there are 2 things i want to leave out: sub-folders, and any file with a type Main
So, if i go to filter query and type: 
Author0 eq null and FSObjType eq 0 and ToFilterNotifications ne 'Main'
It brings me all the pages where the Author column is empty and it does not include Folders or those tagged as Main
If i try to add another column for example Reviewed_x0020_By eq null then it still only bring the ones with Author empty but not the ones with Reviewed by empty.
I tried
Reviewed_x0020_By eq null or Author0 eq null and FSObjType eq 0 and ToFilterNotifications ne 'Main'
(Reviewed_x0020_By eq null or Author0 eq null) and FSObjType eq 0 and ToFilterNotifications ne 'Main'
(Reviewed_x0020_By eq null or Author0 eq null) and (FSObjType eq 0 and ToFilterNotifications ne 'Main')
(Reviewed_x0020_By eq null and FSObjType eq 0 and ToFilterNotifications ne 'Main') or (Author0 eq null and FSObjType eq 0 and ToFilterNotifications ne 'Main')
 
ETC
 
is there a way to get this done?
Basically I want it to bring all the items where
Reviewed By or Review Date or Approved by or Approval Date or Document type or ref number or System
and Type is 0 and FilerNotification is not Main
 
 
Really hope there is a way, that will allow me to run only one flow instead of 7
 
Thank you
Categories:
I have the same question (0)
  • Suggested answer
    Mark Nanneman Profile Picture
    991 Super User 2025 Season 2 on at
    If you're doing a complicated filter with a bunch of Or statements, it might be helpful to write them out in psuedo code somewhere.  Put each filter logic on a line in parenthesis.  You coudl also even test each one out one by one in your flow then save them in a note pad when you get them right. 
     
    Then just put them in parenthesis and join them with Or
     
    (<filter logic A>) or
    (<filter logic B>) or
    (<filter logic C>)
     
    Keep in mind that your filter returns whatever results in "true". 

    I can't quite follow what exactly you want in your post, so again, maybe put it in psuedo code (or write out in two columns what you want and what you don't want in the results).

    If you want to get ('Reviewed by' = null) OR ('Author' = null AND 'FS Object Type' = 0 AND "To Filter Notifications' ne 'Main'), try:

    (Reviewed_x0020_By eq null) or
    (Author0 eq null and FSObjType eq 0 and ToFilterNotifications ne 'Main')

    In this example above, you will get records where reviewed by is null but there might be an author.  You'll also get null authors that might have a reviewed by, etc.


    Another thing you can do if you're working with a Dataverse table is construct a view in a Model Driven App (or in a solution in make.powerapps.com).  Then you can use the FetchXML to filter in Power Automate instead of OData.
     

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 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard