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

Highlighted
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

Highlighted
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
Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

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 (7,259)