cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sasrsc
Resolver II
Resolver II

Filter a gallery including an "empty" dropdown at the beginning....

I am having some odd behavior ... and I want to know the best practice way for doing this ... I have a gallery that has plenty of rows.

 

If I select a specific aircraft in the DdAircraftFilter dropdown list there is no problem. Filter(CollectionComplianceApproval,ComplianceStatus.Value="Not Started" && Title=DdAircraftFilter.Selected.Result && IpPaxNameSearch.Text in TravelerName && IpRouting.Text in Routing && PaxOnTrip=true)

 

The gallery filters just fine when I select a value from the dropdown list (DdAircraftFilter) But I have AllowEmptySelection set to true for the dropdown list in the hope that if the value is empty it will show all the rows that meet the criteria ignoring the dropdown. But that's not working. This seems extreme but should I do ...

 

If(IsBlank(DdAircraftFilter.Selected),Filter(CollectionComplianceApproval,ComplianceStatus.Value="Not Started" && IpPaxNameSearch.Text in TravelerName),Filter(CollectionComplianceApproval,ComplianceStatus.Value="Not Started" && Title=DdAircraftFilter.Selected.Result && IpPaxNameSearch.Text in TravelerName))

 

That does work but is there a cleaner more efficient code way to do that... Basically it's a simple if... If(IsBlank(DdAircraftFilter.Selected), code without the filter by the dropdown value, else filter with the dropdown value

 

The other thing is that allow it will default to the blank row once you select an aircraft you can't go to empty again... The items value for the dropdown is ... Distinct(ComplianceApproval,Title) I figured the empty value would remain an option somehow. How do I achieve that?

1 ACCEPTED SOLUTION

Accepted Solutions
v-bofeng-msft
Community Support
Community Support

Hi @sasrsc :

Could you tell me if this is what you need:

  • Simplify the formula you mentioned above.
  • Allow dropdown to select a null value after making a selection.

If so,I have two suggestions:

  • Replace the dropdown control with a combo box control.(Just click "X" in the search box to delete the selected option and let this control select a null value)
  • 51.gif
  • Use If(IsBlank(XX)……) as the condition of the filter function.For example
Filter(CollectionComplianceApproval,
       ComplianceStatus.Value="Not Started" && (IsBlank(DdAircraftFilter.Selected) || Title=DdAircraftFilter.Selected.Result) && IpPaxNameSearch.Text in TravelerName)

Best Regards,

Bof

View solution in original post

2 REPLIES 2
v-bofeng-msft
Community Support
Community Support

Hi @sasrsc :

Could you tell me if this is what you need:

  • Simplify the formula you mentioned above.
  • Allow dropdown to select a null value after making a selection.

If so,I have two suggestions:

  • Replace the dropdown control with a combo box control.(Just click "X" in the search box to delete the selected option and let this control select a null value)
  • 51.gif
  • Use If(IsBlank(XX)……) as the condition of the filter function.For example
Filter(CollectionComplianceApproval,
       ComplianceStatus.Value="Not Started" && (IsBlank(DdAircraftFilter.Selected) || Title=DdAircraftFilter.Selected.Result) && IpPaxNameSearch.Text in TravelerName)

Best Regards,

Bof

View solution in original post

ok, thank you that makes it easier it works which is fabulous.

Just simply saying if it's blank or the selected value. wow, so simple. 

sometimes you can't see the forest for the trees.

Hadn't thought of doing a combo.

thank you v-bofeng-msft

 

 

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,963)