PowerApps IsEmpty vs IsBlank | What to use when and how

PowerApps IsEmpty Vs IsBlank

PowerApps IsEmpty and IsBlank were very confusing to me when I started with PowerApps. I was used to use the terms blank and empty with different meanings from my progamming background. This article should clarify the differences and explain when to use which function.

Before we go into details. If there should be one lesson you take away from this article, it should be this:

Use IsBlank with strings and use IsEmpty with collections and tables.

IsBlank

The PowerApps IsBlank function returns true for two inputs:

  1. Blank()
  2. “” (empty string)

That’s it.

Syntax

IsBlank( Value )

Examples

IsBlank(Blank()) // Returns true
IsBlank("") // Returns true

IsBlank(" ") // Returns false
IsBlank([]) // Returns false

IsEmpty

The PowerApps IsEmpty function online evaluates to true for an empty collection or table.

Syntax

IsEmpty( Table )

Examples

IsEmpty([]) // Returns true

IsEmpty("") // Returns false
IsEmpty([""])  // Returns false
IsEmpty(Blank()) // Returns false

Validating UI Controls with IsBlank & IsEmpty

Since using IsBlank and IsEmpty is often used to valdiate mandatory data within forms, I like to show how you can check wheter a certain control is set or not.

Take a look at the table and see how to check, wheter the control was set or not.

Input controlValue check
Combo boxIsEmpty(ComboBox1.SelectedItems)
Date pickerIsBlank(DatePicker1.SelectedDate)
Drop downIsBlank(Dropdown1.SelectedText.Value)
List boxIsEmpty(ListBox1.SelectedItems)
RadioIsBlank(Radio1.Selected)
Text InputIsBlank(TextInput1.Text)

Leave a Comment

Your email address will not be published. Required fields are marked *