cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
olsen9
Resolver II
Resolver II

Formatting help: either field can be blank, displaymode.disabled is true, edit for false

If(
IsBlank(Checkbox1.Value) Or (IsBlank(DatePicker1)),
DisplayMode.Disabled,
DisplayMode.Edit
)

 

Currently doesn't work correctly even though i have no errors

1 ACCEPTED SOLUTION

Accepted Solutions

@olsen9 

 

Swap the logic and check for if one is present, and if so use Edit, otherwise use Disabled.

 

 

If(
Checkbox1.Value Or (!IsBlank(DatePicker1)),
DisplayMode.Edit,
DisplayMode.Disabled
)

 

 

Now, if either the checkbox is checked, or the Date Picker is not blank, the other box will be enabled, otherwise it will be disabled:

 

app27c.gif

 

View solution in original post

5 REPLIES 5
Ricardo_Costa
Resolver I
Resolver I

in fact Checkbox1.values is already boolean, so you can try like this

 

If(
Checkbox1.Value Or (IsBlank(DatePicker1.SelectedDate)),
DisplayMode.Disabled,
DisplayMode.Edit
)

NandiniBhagya20
Solution Sage
Solution Sage

Hi,

Please try using below formula -

If(
Checkbox1.Value && !IsBlank(DatePicker1.SelectedDate),
DisplayMode.Edit,
DisplayMode.Disabled
)

or you can try below one 

If(
!Checkbox1.Value Or IsBlank(DatePicker1.SelectedDate),
DisplayMode.Disabled,
DisplayMode.Edit
)

 

 

@olsen9 

Your formula as given

 

If(
IsBlank(Checkbox1.Value) Or (IsBlank(DatePicker1)),
DisplayMode.Disabled,
DisplayMode.Edit
)

 

 

Will not work if the checkbox is unchecked.

 

app27a.gif

 

 

So try it like this instead:

 

If(
!Checkbox1.Value Or (IsBlank(DatePicker1)),
DisplayMode.Disabled,
DisplayMode.Edit
)

 

app27b.gif

 

Check if it helps @olsen9 

olsen9
Resolver II
Resolver II

These work but only if you have a date included, and click checkbox,then the 2nd box is enabled.  as you can see I want either the top fields to be checked or have a date added to enable the disabled box below.  Here is my example of it not working as I checked checkbox1

olsen9_0-1661375481472.png

 

@olsen9 

 

Swap the logic and check for if one is present, and if so use Edit, otherwise use Disabled.

 

 

If(
Checkbox1.Value Or (!IsBlank(DatePicker1)),
DisplayMode.Edit,
DisplayMode.Disabled
)

 

 

Now, if either the checkbox is checked, or the Date Picker is not blank, the other box will be enabled, otherwise it will be disabled:

 

app27c.gif

 

Helpful resources

Announcements
Super User 2 - 2022 Congratulations 768x460.png

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

<
Users online (5,183)