Skip to main content

How to Replace Blank Values in Power Apps with Coalesce

· 3 min read
Jagdish Kumawat
Founder @ Dewiride

Data has gaps: a first name nobody filled in, an optional field left empty. Coalesce gives you a fallback: it returns the first of its values that isn't blank. One short function replaces a longer If with IsBlank, and reads better too.

Syntax​

Syntax
Coalesce( Value1 [, Value2, ... ] )

From Microsoft's reference:

  • It returns the first value that isn't blank and isn't an empty string "".
  • Values after that one aren't evaluated.
  • If every value is blank or empty, it returns blank.
  • All the values must be the same type.

Prerequisites​

Step 1: See It Skip a Blank​

Text control → Text
Coalesce(Blank(), MyProfile.displayName)

The first value is blank, so Coalesce returns the second, the full name:

The formula bar with Coalesce(Blank(), MyProfile.displayName), the preview strip reading Admin User with Data type text

Step 2: Use It for a Real Fallback​

A Microsoft 365 profile doesn't always have a first name. The example greets people by first name, or by full name if there isn't one:

lblWelcomeHS → Text
"Welcome, " & Coalesce(MyProfile.givenName, MyProfile.displayName)

The formula bar with "Welcome, " & Coalesce(MyProfile.givenName, MyProfile.displayName), the preview strip reading Welcome, Admin with Data type text

Coalesce vs If and IsBlank​

These two do the same job:

Equivalent formulas
Coalesce( value1, value2 )
If( Not IsBlank( value1 ), value1, value2 )

Microsoft notes that Coalesce is more concise and doesn't evaluate value1 twice. Use If when the fallback needs different wording, such as a whole sentence; see How to Use the If Function in Power Apps.

Common Mistakes​

MistakeWhat happensDo this instead
Mixing types, such as text and a numberAn errorConvert so all values are the same type
Expecting it to catch errorsErrors aren't blankUse IfError for errors
Putting the fallback firstThe fallback always winsOrder from preferred to fallback

FAQ​

Does Coalesce treat "" as blank?​

Yes. Like IsBlank, it treats an empty string as blank.

Can I add a final default?​

Yes: Coalesce(Nickname, FirstName, "Friend") ends with plain text, which is never blank.

Can Coalesce turn empty strings into blank?​

Yes. Coalesce("") returns blank, which Microsoft points out as a way to convert empty strings.

Conclusion​

Coalesce(preferred, fallback, …) returns the first value that isn't blank or empty. It's the shortest way to write "use this, or else that".

Additional Resources​

Stay Updated

Subscribe to our newsletter for the latest tutorials, tech insights, and developer news.

By subscribing, you agree to our privacy policy. Unsubscribe at any time.