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 / Using IF(AND( function
Power Apps
Answered

Using IF(AND( function

(0) ShareShare
ReportReport
Posted on by 122

I know how to use this in Excel but not in PowerApps.

 

In the attachment, if Score A = Score B AND sRed = True, give me FullNameA.

if Score A = Score B AND sBlue = True, give me FullNameB.

 

The name of the datasource is Results.

 

Help!

2018-03-18_12-40-35.jpg
Categories:
I have the same question (0)
  • timl Profile Picture
    36,795 Super User 2026 Season 1 on at

    Hi @hughrmarks

     

    Supposing that you want to show FullNameA or FullNameB on a label in a card/form, the syntax you would use would look like this:

     

    If(And(ScoreA=ScoreB, sRed=True), 
     FullNameA, 
     If(And(ScoreA=ScoreB, sBlue=True), 
     FullNameB,
     ""
     )
    )
  • hughrmarks Profile Picture
    122 on at

    Thank you.   That makes perfect sense but don't I need to reference the table (Results) in my function since that is the data source I am querying?

  • Verified answer
    timl Profile Picture
    36,795 Super User 2026 Season 1 on at

    Assuming that you're working with a card on a form, you would define your data source and the record that you want to work against at the form level. In the example screenshot that's shown here, you would set the DataSource property to 'Results'.

    FormDatasource.JPG


    If you're not using a form, you would need to call the UpdateContext and Lookup functions to retrieve your record into a variable, and to then apply your If statement against the properties of the variable.  

  • hughrmarks Profile Picture
    122 on at

    I had to make a few tweaks but it worked.   Thanks!

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 476

#2
WarrenBelz Profile Picture

WarrenBelz 365 Most Valuable Professional

#3
Vish WR Profile Picture

Vish WR 339

Last 30 days Overall leaderboard