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

Nested IsBlank and IsEmpty

Hi everyone...

 

I am trying to handle the following; if there is no item selected in a gallery, display the first item in an edit form. I've accomplished that with the If statement below. If the gallery is empty though, I want the edit form to display something like, "No Data."

 

Can someone guide me on how to incorporate what I believe should be an IsEmpty function in to the below expression?

 

If(
IsBlank(Key_Gallery.Selected),
First(Key_Gallery.AllItems
),Key_Gallery.Selected
)

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@Brendan_Hager 

If a gallery has any items in it, then there will *always* be a record selected.  

 

For a label that shows "No data", just add a label and then set the Visible property to:

   CountRows(Key_Gallery.AllItems)=0

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

2 REPLIES 2
RandyHayes
Super User
Super User

@Brendan_Hager 

If a gallery has any items in it, then there will *always* be a record selected.  

 

For a label that shows "No data", just add a label and then set the Visible property to:

   CountRows(Key_Gallery.AllItems)=0

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Thanks @RandyHayes. This did the trick. I added the If statement because the App I inherited is laggy. Without it, we were seeing the app get hung up on, "Getting your data..." at times.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

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.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (2,940)