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 / Multiple if condition
Power Apps
Answered

Multiple if condition

(0) ShareShare
ReportReport
Posted on by 2,567

Hi I need some help getting a multiple if formula right.

 

My current formula seems to work but I'm not sure I'm writing this in the best way.

I want to show the card if the first two options are selected true. If they are not true then I will never show it.
But if the two options are true but SelectSite = MySite and SelectTrainingType = None then it should not show.
If the SelectSite and SelectTraininType is anything else it should still show.

 

The below seems to be working but again I'm I writing this in the best way?

 

If(
 varFormSection = 3 &&
 varManuallyOrImport = "Manually",
 true And If(
 SelectSite.Selected.Result = "MySite" &&
 SelectTrainingType.Selected.Result = "None", 
 false, true))

 

Categories:
  • Jeff_Thorpe Profile Picture
    6,085 Super User 2024 Season 1 on at

    I am not sure if there is a better way but there are other ways to write it. I believe you could do this without the nest if statement. 

    Example:

    If(varFormSection = 3 && varManuallyOrImport = "Manually" && !(SelectSite.Selected.Result = "MySite" && SelectTrainingType.Selected.Result = "None"), true, false)

     

  • JimmyW Profile Picture
    2,567 on at

    @Jeff_Thorpe Thank you for helping out, the formula you provided does not work. This will show the card if SelectTrainingType is anything else then None.

     

    I want to show it if first section of criteria is meet, and I want to hide if second section of the criteria is meet

  • Ethan_009 Profile Picture
    4,838 Moderator on at

    Hi @JimmyWork ,

     

    Nested If won't matter if there's multiple attributes checked and compared.

    You can use switch statements if you are checking 1 control value multiple times with different outputs (example: dropdown items)

     

    You can try some of the formulas below,

    Formula 1: Basic nested IFs

     

    If(
     varFormSection = 3 &&
     varManuallyOrImport = "Manually",
     If(
     SelectSite.Selected.Result = "MySite" &&
     SelectTrainingType.Selected.Result = "None", 
     false, true
     )
    )

     

     

    Formula 2: Using with(). Although I haven't used this often but this saves multiple declaration of same condition if repeated.

     

    With(
     {
     varCheckValues_1: varFormSection = 3 && varManuallyOrImport = "Manually",
     varCheckValues_2: SelectSite.Selected.Result = "MySite" && SelectTrainingType.Selected.Result = "None"
     },
     If(
     varCheckValues_1,
     If(
     varCheckValues_2,
     false,
     true
     ),
     false
     )
    )
    

     

     

    Hope this helps

     

  • JimmyW Profile Picture
    2,567 on at

    @Ethan_R Thank you for answering.

    Do you see anything wrong with my formula, as it is currently working as I want to.

     

    If(
     varFormSection = 3 &&
     varManuallyOrImport = "Manually",
     true And If(
     SelectSite.Selected.Result = "MySite" &&
     SelectTrainingType.Selected.Result = "None", 
     false, true))
  • Verified answer
    Ethan_009 Profile Picture
    4,838 Moderator on at

    No @JimmyWork ,

     

    Your formula is also correct.

    I've just written it simple way as

    If(<anything compared here will give Boolean output>, <execute if output true>, <execute if output false>)

    therefore, I didn't explicitly define true And another if. 

  • JimmyW Profile Picture
    2,567 on at

    @Ethan_R Thank you so much Ethan

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 394 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 324 Most Valuable Professional

Last 30 days Overall leaderboard