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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Nested If Statement
Power Apps
Answered

Nested If Statement

(1) ShareShare
ReportReport
Posted on by 1,360
Hello,
I am attempting to set the visible property for a field to false, but I am having a problem.
The conditions are confusing to me because there are four conditions all using the drpNewOrRenewal dropdown where "New Money and Renewal" is selected.
 
The first condition is as follows:
If(drpNewOrRenewal.Selected.Value = "New Money and Renewal" && drpExistingCust.Selected.Value = "Yes" && IsEmpty(colTypesOfNewMoneyReq) && "Administrative Extension (90-day Extension)" in colTypesOfRenewalReq.Value,false) && varTabSelected = 6 ||
If(drpNewOrRenewal.Selected.Value = "New Money and Renewal" && drpExistingCust.Selected.Value = "Yes" && "Administrative Extension (90-day Extension)" in colTypesOfRenewalReq.Value,true) &&
If(drpNewOrRenewal.Selected.Value = "New Money and Renewal" && drpExistingCust.Selected.Value = "Yes" && "ACH Only" in colTypesOfRenewalReq.Value,true) &&
If(drpNewOrRenewal.Selected.Value = "New Money and Renewal" && drpExistingCust.Selected.Value = "Yes" && "FRG migration in colTypesOfRenewalReq.Value,false) && varTabSelected = 6

The Multi-Select check box has three choices that can be made. "Administrative Extension (90-day Extension)", "ACH Only" and "FRG migration"
 
Notice the first expression and the last expression are false but the rest are true.
These probably be nested and I am not sure how to make it work.

Thank you.
Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    153,084 Most Valuable Professional on at
    The trick with returning a Boolean (yes/no) response is simply making a statement in which all elements need to be true - this returns a true or false output, which translates directly to a Boolean property such as Visible. The below is probably not quite right as I cannot see your full logic, but should be a good start.
    drpNewOrRenewal.Selected.Value = "New Money and Renewal" && 
    drpExistingCust.Selected.Value = "Yes" && 
    (
       "Administrative Extension (90-day Extension)" in colTypesOfRenewalReq.Value || 
       "ACH Only" in colTypesOfRenewalReq.Value
    ) && 
    !IsEmpty(colTypesOfNewMoneyReq) && 
    varTabSelected <> 6
     
    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
    MVP (Business Applications)     Visit my blog Practical Power Apps    Buy me a coffee
  • Verified answer
    ltfDre Profile Picture
    101 on at
    Hi,
     
    I have realized some logic confusion on the power fx formula:
     
    • The first If statement seems to be missing its falseResult part.
     
    • You are chaining multiple If statements without clear control over the flow of the logic. For example, you have overlapping checks for "Administrative Extension (90-day Extension)", which are handled in multiple If statements.
     
    You might want to structure this logic into a single If statement with more complex conditions instead of chaining multiple ones.
     

    If(
        // Check if New Money and Renewal is selected, and Existing Customer is Yes
        drpNewOrRenewal.Selected.Value = "New Money and Renewal" && drpExistingCust.Selected.Value = "Yes", 
        
        // First condition: "Administrative Extension (90-day Extension)"
        If(
            "Administrative Extension (90-day Extension)" in colTypesOfRenewalReq.Value && IsEmpty(colTypesOfNewMoneyReq) && varTabSelected = 6, 
            false,  // return false if true
           
            // Second condition: "ACH Only"
            If(
                "ACH Only" in colTypesOfRenewalReq.Value, 
                true,  // return true if ACH Only is found
                
                // Third condition: "FRG migration"
                If(
                    "FRG migration" in colTypesOfRenewalReq.Value && varTabSelected = 6, 
                    false,  // return false if FRG migration is found
                    
                    // Default action if none of the conditions match
                    false
                )
            )
        ),
        
        // If "New Money and Renewal" or "Existing Customer = Yes" conditions are not met, return false
        false
    )

     
  • WarrenBelz Profile Picture
    153,084 Most Valuable Professional on at
    Please re-look at what I posted as even if it is not totally correct, it is by far the easiest way of handing this - you do not need a false element - just make a statement that need to be collectively true for the control to be visible.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard