Skip to main content

Notifications

Community site session details

Community site session details

Session Id : bT0rc5P/giCb4R1ZeOS5X0
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

🌸 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…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Apps - Building Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 250 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 122

#3
stampcoin Profile Picture

stampcoin 108

Overall leaderboard
Loading started