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 / How to use Filter quer...
Power Automate
Answered

How to use Filter query and more than one condition?

(0) ShareShare
ReportReport
Posted on by 104
Hi! I am trying to use Filter query in Get items but all i get is error messages.
First, i want to Filter out Empty cells in the Approval Date column i tried Approval Date ne 'null', ne null, ne Null etc and it doesn't work.
 
I tried with ApprovalDate ne null and ReviewDate gt ApprovalDate
I tried using ApprovalDate ne null (to limit the amount of items it has to check)
and then add a condition - but when i do this, it opens an Apply to each, and since the outcome was to create a HTML table and email it, with the apply to each i get a table and 1 email per item that meets the conditions.
 
Does anybody have any ideas on how to sort this out? 
been searching everywhere for how to use NE NULL in Filter queries but there is only info on eq null
 
Thank you
 
 
Categories:
I have the same question (0)
  • Infamous_Let Profile Picture
    330 on at

    Filtering out null values in Power Automate can be tricky, especially since different data sources handle them differently. The correct way to filter out empty values is ApprovalDate ne null, but if that doesn’t work, try ApprovalDate ne '' in case it's stored as an empty string instead of null.


    For combining conditions, you should be able to use ApprovalDate ne null and ReviewDate gt ApprovalDate. Just make sure your field names match exactly as they are in your data source, and that the date format is correct.


    About the "Apply to each" issue—this happens because Get items returns an array, even if there's just one result. Instead of applying conditions inside the loop, try using the "Select" action to shape the data first, then create your HTML table from that. 

  • CU07110930-0 Profile Picture
    104 on at
    @Infamous_Let Hi! thank you for your message
    I did try using ne '' but got the same error message
     
    i tried using the Null expression, with and without '' but still the same
     
    And if i do a comparison like Approval_x0020_date lt Review_x0020_Date (or the other way round and using gt)
    with and without inverted commas
     
     
     
    Regarding Apply to each, will it be like this: the problem is that because i am not able to filter with the filter query the table has all the lines in it :(
     
    If you can think of any other solutions, please let me know!
     
    thank you
  • Verified answer
    creativeopinion Profile Picture
    10,502 Super User 2025 Season 2 on at
    @AgainOpen If you want to compare the Approval Date against the Review Date column, you'll need to use a Filter Array action. To ensure your Filter Array action doesn't fail, you'll need to first ensure that you filter our items where the Approval Date and Review Date are not empty.
     
    Approval_x0020_date ne null and Review_x0020_Date ne null
    
    
    If you aren't familiar with the Filter Array action, you may be interested in these YT Tutorials:
     
    Are you using the Microsoft Power Automate Filter Array Action wrong?
    In this video tutorial I’ll show you 3 practical ways to use the Filter Array action and how to use it properly.

    1️⃣ Cross-Referencing Data
    2️⃣ Filtering by Key
    3️⃣ Substring Matching
    Did you know that the Condition action has a limit of 10 conditions? Although it might look like the Filter Array action can only accept one condition—this is not true. By using the advanced mode you can enter multiple conditions into a Filter Array action with an expression.

    IN THIS VIDEO:
    ✓ 3 Ways to Use the Filter Array Action
    ✓ How to use the Scope Action to Group Actions
    ✓ How to Check the Number of Items returned from a Filter Array Action
    ✓ How to Cross-Reference Data in Excel with a SharePoint List
    ✓ How the Filter Array Action Works
    ✓ How to Access the Dynamic Content from a Filter Array Action
    ✓ How to Filter Items by a Key
    ✓ How to Filter Items by Matching a Substring
    ✓ How to Use Multiple Conditions in a Filter Array Action

    ---

    Filter Array + Apply to Each: The Best Tip You Need to Know
    In this tutorial—I’m going to show you a quicker way to get the dynamic content from your Filter Array action—and it doesn’t require writing an expression.

    IN THIS VIDEO:
    ✓ How to Loop Through Filter Array Results in Power Automate
    ✓ Using Apply to Each with Filtered Arrays
    ✓ The Easiest Way to Access Dynamic Content from Filter Array
    ✓ Fixing Nested Apply to Each Actions
    ✓ When to Use Value vs. Body Dynamic Content
    ✓ Simplifying Power Automate Flows with Filter Array
    ✓ Troubleshooting Filter Array and Apply to Each Issues
     
    ---
     
    To send a single email with multiple SP items, you may be interested in this YT Tutorial:

    Building a Power Automate flow that will send an email with multiple SharePoint items can be a bit complex. In this video tutorial I’ll cover how to build a flow that will send a single email to each user with tasks that have been assigned to them. The logic in this flow can be applied to many different scenarios.

    First, I’ll show you how to use a Filter Query to return items from your SharePoint list that meet your criteria. Then I’ll show you how to return a list of unique email addresses so that each user receives a single email. Lastly I’ll show you how to compose an email that will contain an HTML table with a list of tasks for each user.

    IN THIS VIDEO:
    ✓ How to send multiple list items in a single email with a Power Automate Flow
    ✓ How to create a dynamic date range
    ✓ How to use the Convert Time Zone action
    ✓ How to use a Filter Query in the Get Items action
    ✓ How to count number of items in an array
    ✓ How to use the Select action to extract a users display name and email address
    ✓ How to create a unique list of email addresses
    ✓ How to use the Create HTML Table action
    ✓ How to customize the HTML Table with CSS styles
    ✓ How to use the Send an email (V2) action
    ✓ How to use the Append to String Variable action
    ✓ How to create a custom list of items for an email
    ✓ How to use the Send an email (V2) action
    ✓ How to display singular or plural text based on the number of items returned
     
    If you still run into issues while building your flow, share screenshots of your full flow and the logic behind it. Ensure you click each action to expand it.
    Upload a screenshot of your flow in edit mode
     
    Hope this helps!

    Consider giving me a ❤️ if you liked my response!

    👉 Level up your Power Automate skills by checking out my tutorials on YouTube
    👉 Tips and Tricks on TikTok and Instagram
     

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