CRM Crate

How to operate with Blank / Empty values in Power Apps?

We will learn to operate with blank / empty values in Power Apps. Before we start, make sure to subscribe to CRM Crate so that you can stay up to date in the field of Power Apps.

power apps empty value

What is Power FX?

Microsoft’s Power Fx is the low-code language that will be used across Power Platform. It’s a strong-typed, general-purpose, declarative, and functional programming language. Power Fx is expressed in user-friendly text. It’s a low-code language that citizen developers & makers can work with directly in an Excel-like formula bar or Visual Studio Code text window.

It enables a complete range of development from no-code for those who have never programmed before to “pro-code” for the seasoned professional, with no learning or rewriting cliffs in between, enabling diverse teams to collaborate and save time and expense.

power apps empty value

Understanding Blank() function

Blank()

The Blank function returns a blank value. Use this to store a NULL value in a data source that supports these values, effectively removing any value from the field.

Blank()

The result will be blank or empty “” as per the nature of the function.

Understanding IsBlank() function

IsBlank( Value )

The IsBlank function tests for a blank value or an empty string. The test includes empty strings to improve app creation since some data sources and controls use an empty string when there is no value present.

IsBlank( “”)

The result will be “true” as the input parameter passed to the function is empty.

IsBlank( “CRM Crate”)

The result will be “false” as the input parameter passed to the function is not empty.

Understanding IsEmpty() function

IsEmpty (Table)

The IsEmpty function tests whether a table contains any records. It’s equivalent to using the CountRows function and checking for zero. You can check for data-source errors by combining IsEmpty with the Errors function. The return value for IsEmpty is a Boolean true or false.

IsEmpty(IceCream)

The result will be “false” as the table “IceCream” contains two rows named as “Strawberry” and “Chocolate”.

IsEmpty(IceCream)

The result will be “true” as the table “IceCream” does not contain any rows in it.

Understanding Coalesce() function

Coalesce (Value1 [, Value2, ….])

The Coalesce function evaluates its arguments in order and returns the first value that isn’t blank or an empty string. Use this function to replace a blank value or empty string with a different value but leave non-blank and non-empty string values unchanged. If all the arguments are blank or empty strings then the function returns blank, making Coalesce a good way to convert empty strings to blank values.

Coalesce( Blank(), 99999 )

The result will be “99999” as first argument is blank. Because the first argument is blank, evaluation continues with the next argument until a non-blank value and non-empty string is found.

Coalesce( “”, “8” )

The result will be “8” as first argument is blank or empty. Because the first argument is blank, evaluation continues with the next argument until a non-blank value and non-empty string is found.

Coalesce( “” )

The result will be “blank” as first argument is blank or empty. Because the first argument is blank, evaluation continues with the next argument until a non-blank value and non-empty string is found.

Coalesce( Blank(), “”, Blank(), “”, “2”, “1” )

The result will be “2” as first argument is blank or empty. Because the first argument is blank, evaluation continues with the next argument until a non-blank value and non-empty string is found.

Implementation of the above given Power FX formulas in Power Apps

The above Power FX formula implementation is demonstrated in the below given animation.

power apps empty value

Thus, we learned to operate with Blank / Empty values in Power Apps.

5 1 vote
Article Rating
Subscribe
Notify of
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
error: CRM Crate Security Engine - Disabled Right Click & Selection!

Congratulations!

Well Done,
Welcome to CRM Crate

Stay tuned with us and get all latest updates and learning in Microsoft CRM and related techonologes.