cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Damndionic360
Frequent Visitor

Unexpected Behavior - DisplayMode on Button

I'm trying to do required fields not using a form and for text fields I can successfully disable the button based on 

 

If(IsBlank(TextBox.Text)

 

 

Example:

 

If(
!IsBlank(TextBox1.Text)
And !IsBlank(TextBox2.Text)
And !IsBlank(TextBox3.Text)
And !IsBlank(TextBox4.Text),
DisplayMode.Edit, DisplayMode.Disabled
)

 

 

But when I attempt to add a value match for a drop down item, it breaks.

Disabling the button just based on the drop down does work on its own

 

If(DropDown_1.Selected.Value="Please Select", DisplayMode.Disabled, DisplayMode.Edit)

 

 

When I combine them, it breaks or reverses the condition and I cannot figure out why. 

How do you correctly integrate different field types with the DisplayMode behvaior? 

 

The below is ultimetly what I'm trying to get working, and in this condition it just completely disables the button regardless of the various fields state

 

If(
!IsBlank(Text1.Text)
And !IsBlank(Text2.Text)
And !IsBlank(Text3.Text)
And !IsBlank(Text4.Text)
And !IsBlank(Text5.Text)
And Drop_Down1.Selected.Value="Please Select"
And Drop_Down2.Selected.Value="Please Select",
DisplayMode.Edit, DisplayMode.Disabled
)

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
LaurensM
Memorable Member
Memorable Member

@Damndionic360 your last code will enable the button only if both dropdowns have "Please Select" selected.
Please try the following adjustment (<> instead of =):

If(
!IsBlank(Text1.Text)
And !IsBlank(Text2.Text)
And !IsBlank(Text3.Text)
And !IsBlank(Text4.Text)
And !IsBlank(Text5.Text)
And Drop_Down1.Selected.Value <> "Please Select"
And Drop_Down2.Selected.Value <> "Please Select",
DisplayMode.Edit, DisplayMode.Disabled
)

 
I hope this helps!

View solution in original post

4 REPLIES 4
Rusk
Responsive Resident
Responsive Resident

Are you getting a warning if you only use

 

If(Drop_Down2.Selected.Value="Please Select", Edit, Disabled)

 

 

You may need to try .SelectedText.Value

 

If(Drop_Down2.SelectedText.Value = "Please Select", Edit, Disabled)

 

 

LaurensM
Memorable Member
Memorable Member

@Damndionic360 your last code will enable the button only if both dropdowns have "Please Select" selected.
Please try the following adjustment (<> instead of =):

If(
!IsBlank(Text1.Text)
And !IsBlank(Text2.Text)
And !IsBlank(Text3.Text)
And !IsBlank(Text4.Text)
And !IsBlank(Text5.Text)
And Drop_Down1.Selected.Value <> "Please Select"
And Drop_Down2.Selected.Value <> "Please Select",
DisplayMode.Edit, DisplayMode.Disabled
)

 
I hope this helps!

Thank you! 

Drrickryp
Super User
Super User

@Damndionic360 

Alternatively,

If(
Or(IsBlank(Text1.Text),IsBlank(Text2.Text),IsBlank(Text3.Text),
IsBlank(Text4.Text),IsBlank(Text5.Text), Drop_Down1.Selected.Value= "Please Select",
Drop_Down2.Selected.Value= "Please Select"),
DisplayMode.Disabled, DisplayMode.Edit)

If any of the textinput boxes are empty or if either dropdown has "Please Select"  the button will be disabled. 

 

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (6,492)