cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
starwispy
Level: Powered On

Customise filtered gallery display for when there are no matches

I have a PowerApp connected to a SharePoint list, with two drop-down controls connected to filter the Browse Gallery.  In my SharePoint list, the two fields used for the filters are both non-mandatory and have no default value set, and in the PowerApp, the Default property for each drop-down control is set to "".

 

PowerApp1.png

 

 

PowerApp2.png

 

 

The Items property on my drop-down controls is set to:

Distinct('Council ICT Projects PowerApp', OwnerCustom)

 

The Items property on the Browse Gallery is set to:

SortByColumns(Filter('Council ICT Projects PowerApp', DropdownOwner_BrowseFiltered.Selected.Value in OwnerCustom && DropdownStage_BrowseFiltered.Selected.Value in StageCustom), "Created", If(SortDescending1, Descending, Ascending))

 

 

The problem is that when the PowerApp loads, it displays a value in the drop-down and there is no way clear it or display all list items by default, and then filter only on drop-down selection.  On screen load the filters should be empty, e.g.

 

PowerApp4.png

 

I'd also like to display text when no results are returned to the Browse Gallery, e.g.

 

PowerApp3.png

 

 

Can anyone please help me to achieve this?  I believe it will make the app much more user-friendly.

 

Thank you!

3 REPLIES 3
Community Support Team
Community Support Team

Re: Customise filtered gallery display for when there are no matches

Hi @starwispy,

 

For the dropdown control, I am afraid it is not available to configure it with the blank option.

The Dropdown control documentation shares that, Dropdown is

"

A list that shows only the first item unless the user opens it.

"

And the default property would only work if the item is set within the value range configured in the items property.

 

For the error message, please set the onselect property of the Dropdown control with the formula below:

If(

  IsEmpty(

SortByColumns(Filter('Council ICT Projects PowerApp', DropdownOwner_BrowseFiltered.Selected.Value in OwnerCustom && DropdownStage_BrowseFiltered.Selected.Value in StageCustom), "Created", If(SortDescending1, Descending, Ascending))

           ),

UpdateContext({Showerror:true}),

UpdateContext({Showerror:false})

)

Then add a text box, configure the following properties:

Text property = "No results was found that match those filters."

Color property = RGBA(255,41,43,1)

Visible property = Showerror

Italic property = true

 

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
starwispy
Level: Powered On

Re: Customise filtered gallery display for when there are no matches

Hi @v-micsh-msft,

Thanks for your reply, Michael!!  I did tweak your solution a bit, as I found that using the onselect property worked when first selecting values from the drop-down, but if they were then reselected to choose another value the message would reappear over the gallery text.  I was able to modify your solution as follows to achieve the desired outcome:

 

Leave the OnSelect property for dropdown controls set to false

 

Set the Visible property for the textbox to:

 

If(
  IsEmpty(
SortByColumns(Filter('Council ICT Projects PowerApp', DropdownOwner_BrowseFiltered.Selected.Value in OwnerCustom && DropdownStage_BrowseFiltered.Selected.Value in StageCustom), "Created", If(SortDescending1, Descending, Ascending))
           ),
true,
false
)

 

Thank you very much - your help was invaluable! Smiley Very Happy

Nikhil2
Level 8

Re: Customise filtered gallery using dropdown

Hello,

 

Could anyone help me on this issue, Below is the powerapp which i am using to filter the gallery(documents) from the sharepoint library.

 

I have tried with many filter possibilites but it works either ways but i am looking for 2 sort of filters at a same time and also to download the multiple documents using checkbox.

 

1. Is it possible to filter the gallery by selecting values from the dropdown individually, For Ex: if i select training level and as a option "anything", i need to see or filter only training level documents which was defined in the sharepoint doc library and same way goes to all the dropdown Independent or as a one by one. Well i am using Distinct(Table,Column name) for the all the drop downs to fetch the values. The more the filter goes, the gallery should start with filter dynamically.

 

2. Second approch, If i set values to all the dropdowns according to the selection i need see the results in the gallery.

 

3. There is a displaymode set to the below 3 dropdowns, i have value in training level when i select "-" other two dropdowns will be invalid.

 

To Add on, For example:

 

4. This has to work like actual filter, When i select Training level "-" the result should pop up in gallery and show all documents which there under "-". And when actual filter applies to all the dropdowns it should provide the result.

5. And when i select Training level "-" and Application "Any Option" it should filter matching the variables and it should keep filtering accordingly. As many as filter if i apply it should provide the matching documents.

6. On Items for gallery, like i said it works either ways(since i am using "And"/"Or"). So it is either working for "And" otherwise "Or " Sort(Filter('Test Document',And(Training_x0020_Level=Dropdown1.Selected.Value,Application.Value=Dropdown2.Selected.Value,Package.Value=Dropdown3.Selected.Value,Language.Value=Dropdown4.Selected.Value,Medium.Value=Dropdown5.Selected.Value)),Modified,Descending). In my case it should work for both.

 

 

Trainer Cockpit.PNGCapture11.PNG

Please contact me for more info, Thanks in Advance and appreciated !

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 60 members 4,933 guests
Please welcome our newest community members: