Skip to main content

Notifications

Community site session details
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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

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

Leaderboard > Power Apps - Building Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 283 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 146

#3
stampcoin Profile Picture

stampcoin 130

Overall leaderboard
Loading started
Loading started