cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
RoyDsouza
Helper I
Helper I

How to include Multiple IsBlank within a single If function

Hi Power Community experts, 

 

I am trying to disable/enable a Submit Button only when certain required fields are filled out. (9 required fields to be exact) 

I am not using an edit form but many Text,Combo,Dropdown boxes which I have to individually make sure are not blank upon a submit button. 

The formula in the display mode property of the Submit Button works only for one ISblank expression:

If(IsBlank(RegionDrpDown),DisplayMode.Disabled,DisplayMode.Edit) 

What does not work: 

If(And(IsBlank(RegionDrpDown),Isblank(TopicDropdown)),DisplayMode.Disabled,DisplayMode.Edit)

or 

If(IsBlank(RegionDrpDown.Selected.Value And TopicDropdown.Selected.Value And LocationDropdown.Selected.Value And DateDrpDown.Selected.Date),DisplayMode.Disabled,DisplayMode.Edit) 

or

If(IsBlank(RegionDrpDown), DisplayMode.Disabled,DisplayMode.Edit) ; or && If(IsBlank(TopicDrpDown),DisplayMode.Disabled,DisplayMode.Edit)

 

also i get an error: Expected Enum value when I try to write two if statements as above. 

 

Please help how I can accommodate 9 required field values as Multiple Isblanks within a display mode property. 

 

Thank you 

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
PG_WorXz10
Resident Rockstar
Resident Rockstar

Hi @RoyDsouza ,

 

Please try below code. 

If(IsBlank(RegionDrpDown.Selected.Value) || IsBlank(TopicDropdown.Selected.Value) || IsBlank(LocationDropdown.Selected.Value) || IsBlank(DateDrpDown.Selected.Date) ,DisplayMode.Disabled,DisplayMode.Edit)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

If this post was helpful or you need more help please consider giving Thumbs Up and Tag me in your reply I'll be happy to help. If this post helped you solve your issue please click Accept as solution and provide Thumbs Up. This will help others find it more readily.

View solution in original post

Hi @PG_WorXz10 , 

Thank you for the solution- The || operator worked perfectly. 

However, i am in doubt as to how did an OR operator worked when rather logically it should be AND. 

Please shed some light 🙂 

View solution in original post

4 REPLIES 4
PG_WorXz10
Resident Rockstar
Resident Rockstar

Hi @RoyDsouza ,

 

Please try below code. 

If(IsBlank(RegionDrpDown.Selected.Value) || IsBlank(TopicDropdown.Selected.Value) || IsBlank(LocationDropdown.Selected.Value) || IsBlank(DateDrpDown.Selected.Date) ,DisplayMode.Disabled,DisplayMode.Edit)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

If this post was helpful or you need more help please consider giving Thumbs Up and Tag me in your reply I'll be happy to help. If this post helped you solve your issue please click Accept as solution and provide Thumbs Up. This will help others find it more readily.

Hi @PG_WorXz10 , 

Thank you for the solution- The || operator worked perfectly. 

However, i am in doubt as to how did an OR operator worked when rather logically it should be AND. 

Please shed some light 🙂 

Hi @RoyDsouza ,

 

As per your requirement if any of the control is blank if should be disabled. 

Logically: from given values if you want to check Any of the values is true (OR) 

Logically: from given values if you want to check All of the condition is true (AND)

 

In your case the code was when all are blank than Disable. If any of the values are not blank it wont disable. So I just changed the code to if any of the control is blank Disable. 

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

If this post was helpful or you need more help please consider giving Thumbs Up and Tag me in your reply I'll be happy to help. If this post helped you solve your issue please click Accept as solution and provide Thumbs Up. This will help others find it more readily.

Hi @PG_WorXz10 , 

You explained that very well. Thank you so much. 

Helpful resources

Announcements
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

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