web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to use if function...
Power Apps
Answered

How to use if function to deal with two condition items?

(1) ShareShare
ReportReport
Posted on by 201

Dear all:

 

I am a starter for power apps with sharepoint.

Now i have one question about how to use IF function.

The situation is that i have a condition, if the condition "ApproverEmail" is Blank(), then send email to user().Email for "TEST1", if the condition "ApproverEmail is not Blank(), then send email to User().Email for "TEST2"

IF ApproverEmail = Blank() Then send email to User().Email for "TEST1"

IF ApproverEmail <> Blank() Then send email to User().Email for "TEST2"

But i don't know how to write IF function by Power apps for above case.

 

Would you please help me ?

Thanks a lot!

Categories:
I have the same question (0)
  • Verified answer
    iAm_ManCat Profile Picture
    18,256 Most Valuable Professional on at
    If(
     //Condition 1
     ApproverEmail = Blank()
     ,
     //Result 1
     "Then send email to User().Email for TEST1 "
     ,
     //Condition 2
     ApproverEmail <> Blank()
     ,
     //Result 2
     "Then send email to User().Email for TEST2 "
    )

     

    Change the text part to the actual function for sending emails as you have in your app, but this is the correct If function formatting

  • Jackywei_BDF Profile Picture
    201 on at

    @iAm_ManCat ï¼š

     

    Yes, it is working now.

    Sorry for later reply.

    By the way, it is possible i run two steps for one condition?

    For example:

    If(

     ApproverEmail = Blank()

    ,

    Send Email to user & Patch( list1, { ApprovalStatus : "Approved" })

    )

     

     

    Thanks for your support:)

  • iAm_ManCat Profile Picture
    18,256 Most Valuable Professional on at

    Yes of course 🙂

     

    You can separate additional code within the same step with a semi-colon like this:

     

    If(
     //Condition 1
     ApproverEmail = Blank()
     ,
     //Result 1
     "Then send email to User().Email for TEST1 " ;
     Patch(DataSource, Lookup(datasource, ID = ThisItem.ID), {ApprovalStatus: "Approved"}) ;
     Navigate('Home Screen')
     ,
     //Condition 2
     ApproverEmail <> Blank()
     ,
     //Result 2
     "Then send email to User().Email for TEST2 "
    )

     

    You can add as many extra steps as you want, and you can also add additional If statement checks by putting another comma in and having a third condition that gives a third result etc etc

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 536

#2
WarrenBelz Profile Picture

WarrenBelz 426 Most Valuable Professional

#3
Haque Profile Picture

Haque 305

Last 30 days Overall leaderboard