cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
adove
Helper II
Helper II

Conditional logic on DisplayMode of a Button

I have two dropdown lists. List A is a manually populated list with its first value being "". List B is a dynamically populated list with its initial default value blank. I have a submit button "btnSubmit" that I would like conditional logic applied to only make clickable if either BOTH dropdowns are not blank OR both values are NOT filled. Only one of the dropdowns should have a value for the submit button to be clickable.

 

My initial attempts to get the button to function have failed even with basic if statements applied to the dropdowns. When I attempt to apply the logic, I get errors in the formula. For instance, when I type If(ddlListA.Selected.Value <> ""),DisplayMode.Edit,DisplayMode.Disabled) It errors on the "value" in the formula as if that is not a valid call. When I use the real name of the cell, however, I don't get the errors (although the logic still doesn't work), such as If(ddlListA.Selected.'Real Name' <> ""),DisplayMode.Edit,DisplayMode.Disabled).

 

While I am trying to get the more complex conditional formatting applied to the submit button, I can't even get the most basic logic applied. Any ideas on what I am doing wrong?

 

Thanks for the help.

A.Dove

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@adove 

Your formula on the DisplayMode property of your Button should be the following:

If(
    !IsBlank(ddListA.Selected.'Real Name') || !IsBlank(ddListB.Selected.Value),
    Edit,
    Disabled
)
    

Now, for the 'Real Name' and the Value on ListA and ListB respectively, this is all going to depend on the Items property of those controls.  If you still run into issues with it, then post back with the Items properties of those two controls.

 

Also, you mentioned "OR both value are NOT filled" - are you referring to some other controls, or did I misunderstand?

 

I hope this is helpful for you.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

3 REPLIES 3
adove
Helper II
Helper II

I have also tried another formula, but it also does not work correctly. Although there are no formula errors, the result is that the button simply does not so at all.

 

If(Len(ddlListA.Selected.'Full Name') >= 1,DisplayMode.Edit,DisplayMode.Disabled)

 

Any help would be appreciated.

Thanks

A.Dove

RandyHayes
Super User
Super User

@adove 

Your formula on the DisplayMode property of your Button should be the following:

If(
    !IsBlank(ddListA.Selected.'Real Name') || !IsBlank(ddListB.Selected.Value),
    Edit,
    Disabled
)
    

Now, for the 'Real Name' and the Value on ListA and ListB respectively, this is all going to depend on the Items property of those controls.  If you still run into issues with it, then post back with the Items properties of those two controls.

 

Also, you mentioned "OR both value are NOT filled" - are you referring to some other controls, or did I misunderstand?

 

I hope this is helpful for you.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

@RandyHayes 

 

Using your formula I expanded it to the following working solution. Thank you for your assistance.

 

If(
((IsBlank(ddlPartner.Selected.'Full Name') && IsBlank(ddlPartnerType.Selected.PartnerTypeCalculated)) || (!IsBlank(ddlPartner.Selected.'Full Name') && !IsBlank(ddlPartnerType.Selected.PartnerTypeCalculated))),
Disabled,
Edit
)

 

Regards,

ADove

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,347)