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

Enable button tied to multiple statements

Hi team,

 

I'm attempting to control the display mode of a button based on whether certain fields have been populated or not. Sounds simple in theory, however I have myself tangled with this one.  The image of the screen is attached.  My goal is to have all of the LM and RUL text boxes filled out OR the N/A checkboxes ticked true to allow for the Save and Continue button to enable.

 

The IsBlank for the text values is working, however as soon as I introduce the OR checkbox.Value=false, it falls apart.  I feel like there's a certain structure to this statement that I am not getting.  Any assistance would be greatly appreciated as always!

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @Marty_Dub ,

This is a logic, not a coding exercise - I was only copying your code to show syntax improvement, not knowing exactly what you wanted - is this the logic?

If(
   (
      (
	     IsBlank(txtQ119.Text) || Value(txtQ120.Text) < 4
      ) && !chkQ119.Value
   ) || 
   (
      (
         IsBlank(txtQ123.Text) || Value(txtQ124.Text) < 4
	  ) && !chkQ123.Value
   ) || 
   (
      (
         IsBlank(txtQ125.Text) || Value(txtQ126.Text) < 4
      ) && !chkQ125.Value
   ) || 
   (
      (
         IsBlank(txtQ127.Text) || Value(txtQ128.Text) < 4
      ) && !chkQ127.Value
   ),
   Disabled, 
   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.

Visit my blog Practical Power Apps

 

View solution in original post

6 REPLIES 6
WarrenBelz
Super User
Super User

Hi @Marty_Dub ,

Can you please post all of that in Text - also why the 0,1,2,3 Disabled arguments?

Hi @WarrenBelz 

 

Thank you - the DisplayMode code for the button is below.  Also, the 0,1,2,3 disabled arguments are because the RUL text fields are not able to contain those values as a business rule.

 

If((IsBlank(txtQ119)) || (IsBlank(txtQ120)) || txtQ120.Text = "0" || txtQ120.Text = "1" || txtQ120.Text = "2" || txtQ120.Text = "3" || chkQ119.Value=false || (IsBlank(txtQ123)) || (IsBlank(txtQ124)) || txtQ124.Text = "0" || txtQ124.Text = "1" || txtQ124.Text = "2" || txtQ124.Text = "3" || chkQ123.Value=false || (IsBlank(txtQ125)) || (IsBlank(txtQ126)) || txtQ126.Text = "0" || txtQ126.Text = "1" || txtQ126.Text = "2" || txtQ126.Text = "3" || chkQ125.Value=false || (IsBlank(txtQ127)) || (IsBlank(txtQ128)) || txtQ128.Text = "0" || txtQ128.Text = "1" || txtQ128.Text = "2" || txtQ128.Text = "3" || chkQ127.Value=false,
Disabled, Edit)

Hi @Marty_Dub ,

Try this

If(
   IsBlank(txtQ119.Text) || Value(txtQ120.Text) < 4 || !chkQ119.Value || 
   IsBlank(txtQ123.Text) || Value(txtQ124.Text) < 4 || !chkQ123.Value || 
   IsBlank(txtQ125.Text) || Value(txtQ126.Text) < 4 || !chkQ125.Value || 
   IsBlank(txtQ127.Text) || Value(txtQ128.Text) < 4 || !chkQ127.Value,
   Disabled, 
   Edit
)

You might also consider renaming your controls - it will make it much easier when you are referencing objects.

 

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.

Visit my blog Practical Power Apps

Hi @WarrenBelz 

 

Unfortunately no luck with that sorry - from the screen shot below, I have values in the Q119, Q120, Q123 & Q124 fields and have selected the N/A checkboxes for the remainder, however the button has not enabled.

 

(p.s thank you for suggestion for naming the controls - I will definitely look at introducing this practice).

Hi @Marty_Dub ,

This is a logic, not a coding exercise - I was only copying your code to show syntax improvement, not knowing exactly what you wanted - is this the logic?

If(
   (
      (
	     IsBlank(txtQ119.Text) || Value(txtQ120.Text) < 4
      ) && !chkQ119.Value
   ) || 
   (
      (
         IsBlank(txtQ123.Text) || Value(txtQ124.Text) < 4
	  ) && !chkQ123.Value
   ) || 
   (
      (
         IsBlank(txtQ125.Text) || Value(txtQ126.Text) < 4
      ) && !chkQ125.Value
   ) || 
   (
      (
         IsBlank(txtQ127.Text) || Value(txtQ128.Text) < 4
      ) && !chkQ127.Value
   ),
   Disabled, 
   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.

Visit my blog Practical Power Apps

 

@WarrenBelz Brilliant - this worked perfectly.  Thankyou again for your assistance.

Helpful resources

Announcements
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.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (2,750)