Skip to main content

Notifications

Community site session details

Community site session details

Session Id : +zgzVEdGvg/Cge9nFaKtjD
Power Apps - Building Power Apps
Answered

How else can I write If(IsBlank(varFoo), varBar, varFoo)?

Like (0) ShareShare
ReportReport
Posted on 14 Mar 2023 08:49:07 by

Most of my Ifs are of the form If(IsBlank(varFoo), varBar, varFoo). Is there a quicker way to write this?

Categories:
  • SoPatt Profile Picture
    Microsoft Employee on 14 Mar 2023 at 11:02:21
    Re: How else can I write If(IsBlank(varFoo), varBar, varFoo)?

    Derp. I had it backwards. Fixed my answer. In any case, Coalesce().

  • Community Power Platform Member Profile Picture
    on 14 Mar 2023 at 10:42:40
    Re: How else can I write If(IsBlank(varFoo), varBar, varFoo)?

    I don't mean what you've suggested. What you've suggested returns Blank() if varFoo is Blank().

  • Verified answer
    SoPatt Profile Picture
    Microsoft Employee on 14 Mar 2023 at 09:11:29
    Re: How else can I write If(IsBlank(varFoo), varBar, varFoo)?

    That would be Coalesce(varFoo,varBar).

    Notably, in behavior properties, I have found that this unfortunately does not short circuit, i.e. both arguments will always get evaluated. 

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,731 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,075 Most Valuable Professional

Leaderboard