cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Resolver I
Resolver I

ifEmpty and else

In one screen I have a gallery with the next button set to:

 

Navigate(Screen1,Fade, {usr: Subtitle2.Text})

 

and in Screen1 I have in Item:

 

If(!IsEmpty(usr), LookUp(Students, Title = usr))

 

and it loads the information on the user from the DataSource. I've added a + button to the gallery screen that does:

 

Navigate(Screen1,Fade, {usr: ""})

 

and changed Screen1 Item to:

 

If(!IsEmpty(usr), LookUp(Students, Title = usr), Defaults(Students))

 

but when usr is "" I get "no item to display" in Screen1. If I use Item: Defaults(Students) it works and displays empty fields that let me add a new record.

 

Is there a way to use isEmpty and else? i.e. if usr is not empty show the record, else use Item: Defaults(Students)

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Resolver I
Resolver I

Re: ifEmpty and else

turned out I needed to use isBlank instead of isEmpty. Curious why "" == isEmpty = false

View solution in original post

Super User
Super User

Re: ifEmpty and else

Hi @codebrane

 

The reason for this behavior is because the IsEmpty function is designed to test for empty tables.

 

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-isblank-isempty

 

In this instance, IsBlank is the correct function because you're testing that the field value "usr" is blank.

View solution in original post

2 REPLIES 2
Highlighted
Resolver I
Resolver I

Re: ifEmpty and else

turned out I needed to use isBlank instead of isEmpty. Curious why "" == isEmpty = false

View solution in original post

Super User
Super User

Re: ifEmpty and else

Hi @codebrane

 

The reason for this behavior is because the IsEmpty function is designed to test for empty tables.

 

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-isblank-isempty

 

In this instance, IsBlank is the correct function because you're testing that the field value "usr" is blank.

View solution in original post

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Robotic Process Automation

Let's talk about the solution provided by Microsoft for Robotic Process Automation (RPA)

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (9,258)