cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Kookykrumbs
Regular Visitor

Combining Two rules for Display Mode for Submit Button

Hello,

 

How do I combine two sets of rules for my Submit button?

 

Both rules individually work, but when I try to put them together using && or &, they don't work anymore.  The rules I'm trying to use for one Submit button are:

 

If(IsBlank(DataCardValue1) || IsBlank(DataCardValue2) || IsBlank(DataCardValue3) || IsBlank(DataCardValue5) || IsBlank(DataCardValue4) || IsBlank(DataCardValue7), Disabled, Edit)

 

and

 

If(DataCardValue4.SelectedDate < Today() - 120, DisplayMode.Disabled, DisplayMode.Edit)

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @Kookykrumbs ,

Just checking if you got the result you were looking for on this thread. Happy to help further if not.

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.

View solution in original post

5 REPLIES 5
eka24
Super User
Super User

Use

If(IsBlank(DataCardValue1) || IsBlank(DataCardValue2) || IsBlank(DataCardValue3) || IsBlank(DataCardValue5) || IsBlank(DataCardValue4) || IsBlank(DataCardValue7) || DataCardValue4.SelectedDate < Today() - 120, DisplayMode.Disabled, DisplayMode.Edit)

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

WarrenBelz
Super User
Super User

HI @Kookykrumbs ,

This should work - please check I have the 120 days the right way around

If(
   (
      IsBlank(DataCardValue1) || 
      IsBlank(DataCardValue2) || 
      IsBlank(DataCardValue3) || 
      IsBlank(DataCardValue5) || 
      IsBlank(DataCardValue4) || 
      IsBlank(DataCardValue7)
   ) &&
   DateDiff(
      DataCardValue4.SelectedDate,
      Today()
   )>120, 
   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.

Hello,

 

@WarrenBelz  thank you for the quick response.  I'm afraid the solution isn't working as I hoped it would.  So, I wanted the submit button to remain grayed out unless DataCards 1-5 &7 are filled out.  But at the same time, I wanted the Submit button to remain grayed out unless the date chosen is within 120 days of today's date. 

 

Upon trying the rule, the second one worked perfectly (the one ensuring that the date is within the parameters I wanted), but unfortunately, I'm still able to submit the form, even though the other fields are blank.  But in practice, I need it to be mandatory that the other fields are completed as well.

 

Do you know if there's a rule for this? 

Hi @Kookykrumbs ,

Just replace the And && with Or ||

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.

Hi @Kookykrumbs ,

Just checking if you got the result you were looking for on this thread. Happy to help further if not.

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.

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (4,482)