Skip to main content

Notifications

Power Apps - Building Power Apps
Unanswered

Multiple condition on display mode on button

(0) ShareShare
ReportReport
Posted on by 143

Hi, 

 

I have button where I need to add condition on Display Mode. 

 

I have 2 dropdown in there I have different values- 

1st Dropdown           2nd Dropdown                 Button

Not ReceivedBlank Enabled 
Partially Received Dynamically select value Enabled 
Partially Received Blank Disabled

 

Please understand condition and give me suggestion.

 

Thanks in advance!

  • WarrenBelz Profile Picture
    WarrenBelz 145,495 on at
    Re: Multiple condition on display mode on button

    @iAM_BA ,

    The issue here is that there are other combinations (2 x 4 = 8 and you have listed 5) - what you need to do is define what is disabled and everything else is enabled, or the reverse. so going by your Table - Enabled

    If(
     (
     Dropdown1.Selected.Value = "Not Received" &&
     Len(Dropdown2.Selected.Value) = 0
     ) ||
     (
     Dropdown1.Selected.Value = "Partially Received" &&
     Dropdown2.Selected.Value = "CMA" 
     ),
     DisplayMode.Edit,
     DisplayMode.Disabled
    )

    or Disabled

    If(
     Dropdown1.Selected.Value = "Partially Received" &&
     (
     Dropdown2.Selected.Value = "DMA" ||
     Dropdown2.Selected.Value = "AMA" ||
     Len(Dropdown2.Selected.Value) = 0
     ),
     DisplayMode.Disabled,
     DisplayMode.Edit
    )

     

    Please click Accept as solution 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 Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • iAM_BA Profile Picture
    iAM_BA 143 on at
    Re: Multiple condition on display mode on button

    Hi @WarrenBelz 

    I am giving in simple table - 

     

    1st Dropdown           2nd Dropdown                            Button

    Not ReceivedBlank Enabled 
    Partially Received Dynamically select value - CMAEnabled 
    Partially Received Dynamic selected Value - DMADisabled 
    Partially Received Dynamic selected Value - AMADisabled 
    Partially Received Blank 

    Disabled 

     

    1st scenario-

    When in second row if I am selecting value as CMA then it should be enabled and in next rows value needs to be select as "CMA" only. Not any other value. 

    2nd Scenario-

    And in this scenario if in row selected "Partially received" and dropdown value is selected as "DMA" then button enabled and in second row if you are selecting "Partially received" and "CMA" then button should be disabled. 

     

    Means when user select any value in second dropdown then that should be uniform for each row. 

     

    If you understand it please let me know. 

     

    Thanks.

  • WarrenBelz Profile Picture
    WarrenBelz 145,495 on at
    Re: Multiple condition on display mode on button

    Hi @iAM_BA ,

    So under what conditions do you need to control disabled ? This should be really simple, but I am getting more unclear the further we go here - can you please list  in simple terms what conditions need to exist to disable the button.

  • iAM_BA Profile Picture
    iAM_BA 143 on at
    Re: Multiple condition on display mode on button

    HI @WarrenBelz 

     

    In Dropdown2 value is dynamic. User can select any one value which is in dropdown. And in next row user need to select value which selected in 1st row. 

     

    Thanks!

  • WarrenBelz Profile Picture
    WarrenBelz 145,495 on at
    Re: Multiple condition on display mode on button

    @iAM_BA ,

    Something like this should do what you need

    If(
     Len(Dropdown2.Selected.Value) = 0 || 
     (
     Dropdown1.Selected.Value = "Partially Received" &&
     Dropdown2.Selected.Value = "cma.test"
     ),
     DisplayMode.Edit,
     DisplayMode.Disabled,
    )

     

    Please click Accept as solution 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 Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • iAM_BA Profile Picture
    iAM_BA 143 on at
    Re: Multiple condition on display mode on button

    Hi @WarrenBelz 

    The scenario is like 

    iAM_BA_0-1697805482697.png

    In 1st case - Save button will enabled

    In 2nd case - Save button will enabled 

    3rd case - There is under data requested from dropdown there is some another value I select then button should be disabled and when I select "cma.test" value then Save button will enabled.

     

    If you need more clarity let me know. 

     

    Thanks. 

     

  • WarrenBelz Profile Picture
    WarrenBelz 145,495 on at
    Re: Multiple condition on display mode on button

    @iAM_BA ,

    Can you please tell me exactly what you want here - under what circumstances do you want the control disabled ? I have no idea what you mean in your last post.

  • iAM_BA Profile Picture
    iAM_BA 143 on at
    Re: Multiple condition on display mode on button

    Hi @WarrenBelz 

     

    But in second dropdown there is not static value. User can select any one value on that basis in new row second dropdown value should be same, which is previous. 

     

    Thanks !

     

  • WarrenBelz Profile Picture
    WarrenBelz 145,495 on at
    Re: Multiple condition on display mode on button

    @iAM_BA ,

    Assuming you mean the value selected is "DMA"

    If(
     Dropdown1.Selected.Value = "Partially Received" &&
     Len(Dropdown2.Selected.Value) = 0 || Dropdown2.Selected.Value = "DMA"
     DisplayMode.Disabled,
     DiaplayMode.Edit
    )

     

    Please click Accept as solution 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 Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • iAM_BA Profile Picture
    iAM_BA 143 on at
    Re: Multiple condition on display mode on button

    HI @WarrenBelz ,

    Thanks for the reply. 

    Actually there is change in this scenario. 

    As once I have selected 2nd dropdown value that should be locked for next row also. 

     

     

    Like I have shown below- 

    1st Dropdown 2nd Dropdown Button

    Not ReceivedBlank Enabled 
    Partially Received Dynamically select value - CMAEnabled 
    Partially Received Dynamic selected Value - CMAEnabled 
    Partially Received Dynamic selected Value -DMADisabled 

     

    All these dropdown are added in the Gallery. And each time I am adding new entry by using Add new button.

     

    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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,495

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,822

Leaderboard