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

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

View solution in original post

Highlighted

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

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

View solution in original post

Highlighted

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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (7,382)