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
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (1,826)