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 Apps / Building OData filter ...
Power Apps
Unanswered

Building OData filter query in Power Apps to run Power Automate export to csv flow

(0) ShareShare
ReportReport
Posted on by 2

Hello,

 

I have a Power App screen that filters a table based on different drop down menus using “= Blank()” to allow blank drop downs without affecting the filter in the table. I am trying to create an OData expression to be entered into the Filter Query field in the SP action step ‘Get Items’ that will filter the SP list based on the drop down inputs on the Power App the same way. I have been able to create one that will require a value in all the drop down fields, but not one that will allow blanks without affecting the filter (i.e. if I leave the Unit field blank, it will pull all records regardless of unit but filter based on the rank only).

 

This is what I have so far (I separated the “ands” to make it easier to see):

 

ExportFCPRosterbyUnit. Run (

"Unit eq ‘" & UnitDropdown_3.Selected.Value & “‘ 

and Rank eq ‘" & RankDropdown_2.Selected.Value & "'

and Marital_×0020_Status eq ‘" & MarritalStatusDropdown_2.Selected.Value & "’

and Mil_x0020_to_×0020_Mil_×0020_Sta eq ‘" & MiltoMiLDropdown_2.Selected.Value & "’

and FCP_×0020 Required eq ‘“ & FCPDropdown_2.Selected.Value & "' ")

 

 

How can I change the OData code to allow for the blank drop downs and not require a selection to return items in the Power Automate flow?

Categories:
  • BDallas Profile Picture
    74 on at

    @Glarson you can modify the OData expression to allow for blank drop-downs by using the or operator in your filter query. Here’s an example of how you can modify your existing expression:

    ExportFCPRosterbyUnit.Run(
     "((Unit eq null) or (Unit eq ‘" & UnitDropdown_3.Selected.Value & “‘)) and 
     ((Rank eq null) or (Rank eq ‘" & RankDropdown_2.Selected.Value & "')) and 
     ((Marital_×0020_Status eq null) or (Marital_×0020_Status eq ‘" & MarritalStatusDropdown_2.Selected.Value & "’)) and 
     ((Mil_x0020_to_×0020_Mil_×0020_Sta eq null) or (Mil_x0020_to_×0020_Mil_×0020_Sta eq ‘" & MiltoMiLDropdown_2.Selected.Value & "’)) and 
     ((FCP_×0020_Required eq null) or (FCP_×0020_Required eq ‘“ & FCPDropdown_2.Selected.Value & "'))"
    )
    Let me know if this works for you. @ me in replies, or I'll lose your thread!!! 
    Note:
    If this post is helpful, please mark it as the solution to help others find it easily. Also, if my answers contribute to a solution, show your appreciation by giving it a thumbs up
  • Glarson Profile Picture
    2 on at

    @BDallas , Thank you for the reply. Unfortunately I am still getting the same results, nothing comes out if I leave any of the drop downs blank. 

  • BDallas Profile Picture
    74 on at

    @Glarson sorry to hear that the previous solution didn’t work. Here’s another approach you can try:

     

    ExportFCPRosterbyUnit.Run(
     "(Unit eq '" & UnitDropdown_3.Selected.Value & "' or Unit eq null) and Rank eq '" & RankDropdown_2.Selected.Value & "' and Marital_×0020_Status eq '" & MarritalStatusDropdown_2.Selected.Value & "' and Mil_x0020_to_×0020_Mil_×0020_Sta eq '" & MiltoMiLDropdown_2.Selected.Value & "' and FCP_×0020 Required eq '" & FCPDropdown_2.Selected.Value & "'"
    )

     

    In this expression, the or operator is used to create a condition that checks if the Unit field is either equal to the selected value or blank(null). This should allow you to filter the SP list based on the drop-down inputs on the Power App, even if some of the fields are left blank.

     

    Let me know if this works for you. @ me in replies, or I'll lose your thread!!!  
    Note:
    If this post is helpful, please mark it as the solution to help others find it easily. Also, if my answers contribute to a solution, show your appreciation by giving it a thumbs up

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 393 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 278 Most Valuable Professional

Last 30 days Overall leaderboard