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 III
Super User III

@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. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

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 III
Super User III

@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. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (38,092)