cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
smilingbo
Frequent Visitor

Display a label when filter returns no results

Hello,

 

I'm trying to display a label when there are no results from filtering a gallery. I've changed the 'onvisible' property to but it is not working:

 

If(IsBlank('HR FAQ'),true,false)

 

Any ideas what I should do?

 

Thanks in advance for any help,

 

Paul

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User
Super User

Hi @smilingbo ,

Put on the Visible property of the Label

CountRows(YourGalleryName.AllItems)=0

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

5 REPLIES 5
WarrenBelz
Super User
Super User

Hi @smilingbo ,

Put on the Visible property of the Label

CountRows(YourGalleryName.AllItems)=0

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

smilingbo
Frequent Visitor

Hellol Warren,

 

Thanks for your response, but it doesn't work for me as it doesn't recognise the 'allitems' element. I tried with a name from my datasouce and this didn't work either (with a combination of IF statement as well). 

 

Do you have any other ideas what I could do?

 

Paul

Hi @smilingbo ,
Can you please supply the code you used (in Text) - AllItems will work on any gallery.

WarrenBelz
Super User
Super User

Hi @smilingbo ,

Just checking if you got the result you were looking for on this thread. Happy to help further if not.

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Hello,

 

I did manage to get it to work with a version of what you put:

 

If((CountRows(If(Gallery5.Selected.Value = "All", Filter('HR FAQ',searchquery in Question),Filter('HR FAQ',searchquery in Question && Category = Gallery5.Selected.Value)))) = 0,true,false)

 

Paul

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (5,009)