cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
IPC_ahaas
Post Patron
Post Patron

ResetForm Broken After Adding Button DisplayMode Condition

Not sure why this happened. I have a reset button with OnSelect=ResetForm(Form1) and DisplayMode=

 

If(
     And(
          (Value(Drp1.SelectedText.Value) = 0),
          (Value(Drp2.SelectedText.Value) = 0)
     ),
     Disabled,
     Enable

)

 

The OnSelect code stopped working once I added the DisplayMode code. The button changes color correctly based on the values for Drp1 and Drp2, so I'm not sure what's going on.

1 ACCEPTED SOLUTION

Accepted Solutions
NandiniBhagya20
Solution Sage
Solution Sage

Hi,
If you are adding the disable code on Display property of a button it will be - 

If(
     And(
          (Value(Drp1.SelectedText.Value) = 0),
          (Value(Drp2.SelectedText.Value) = 0)
     ),
     DisplayMode.Disabled,
     DisplayMode.Edit

)

 


Did you like my post? Please give it a thumbs up! Did I resolve your issue? Please click Accept as Solution to close the topic and so other members of the community can find solutions more easily.

View solution in original post

3 REPLIES 3
NandiniBhagya20
Solution Sage
Solution Sage

Hi,
If you are adding the disable code on Display property of a button it will be - 

If(
     And(
          (Value(Drp1.SelectedText.Value) = 0),
          (Value(Drp2.SelectedText.Value) = 0)
     ),
     DisplayMode.Disabled,
     DisplayMode.Edit

)

 


Did you like my post? Please give it a thumbs up! Did I resolve your issue? Please click Accept as Solution to close the topic and so other members of the community can find solutions more easily.
IPC_ahaas
Post Patron
Post Patron

Bah, that makes so much sense. I knew that too, just got stuck on the fact that it accepted "Enable" and it seemed to work visually, even as the code was within "DisplayMode". Thanks.

IPC_ahaas
Post Patron
Post Patron

@NandiniBhagya20 Somewhat related, I have a multi-Or statement inside an If statement. Basically, if any of the values in the form were changed from their default values, I wanted to enable the Reset button. Is this the best way to do this, because it's not working:

 

DisplayMode=

If(
     !(TxtEmpNameDetails.Text = VarEmpName) ||
     !(TxtEmpIDDetails.Text = VarEmpID) ||
     !(DrpEmpLocationDetails.SelectedText.Value = VarEmpLocation) ||
     !(DrpEmpDepartmentDetails.SelectedText.Value = VarEmpDepartment),
Edit,
Disabled
)

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events that are happening this month - don't miss out!

Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Users online (3,682)