Scott22
Canvas Initiate

Hide/Show a Controls

Jump to solution

Hi Everyone,

I am having an issue making a rule to show/hide a control box. I have represented my situation with the example below.

Lets say I have BoxA which is a Choice Control with selections Left, Right, Center. I have BoxB which is a single line textbox Control and I have BoxC which is a single line textbox Control.

I want BoxB to become visible only when BoxA selection is either Left or Right or if BoxC contains the letters ‘CNVL’.

I also want BoxB to be required to have data in it, if it becomes visible.

Thank you.

Labels: (1)
0 Kudos
Reply
8 Replies
kchaluvadi
Workflow Veteran

Re: Hide/Show a Controls

Jump to solution

Hi,

What kind of Nintex form you are using? Classic/Responsive/New Responsive?

0 Kudos
Reply
Scott22
Canvas Initiate

Re: Hide/Show a Controls

Jump to solution

"Responsive" is what I am using. 

0 Kudos
Reply
kchaluvadi
Workflow Veteran

Re: Hide/Show a Controls

Jump to solution

Looks tricky, what if user selects "Center" and enters "CNVL" in BoxC? 

And you can create a "Mandatory" rule with rule,

When

BoxA = "Left" || BoxA = "Right" || contains("CNVL", "controlname") 

Then

Invalidate

Validation Message 

Please enter data in "controlname"

0 Kudos
Reply
Scott22
Canvas Initiate

Re: Hide/Show a Controls

Jump to solution
Thanks, I am looking into your suggestions above. One question: How do you make a Contains() function a Does Not Contains()?
0 Kudos
Reply
kchaluvadi
Workflow Veteran

Re: Hide/Show a Controls

Jump to solution

Hi,

You have to negate the contains() function, like 

not(contains("CNVL", "controlname")) or   !contains("CNVL", "controlname")

0 Kudos
Reply
Scott22
Canvas Initiate

Re: Hide/Show a Controls

Jump to solution

I have not been successful on finding a solution to my original question. I am now trying to use validation in the control settings-see below.

The regular expression I am using is below:

 

fn-Contains(Material#,"cnvl") && fn-IsNullOrEmpty(Suborder)

 

It works, however, when "cnvl" is contained and when a number is entered in Suborder, the regular expression error message does not clear. I evidently do not have my expression written correctly.

 

Thanks

 

Scott22_0-1626698426630.png

 

0 Kudos
Reply
kchaluvadi
Workflow Veteran

Re: Hide/Show a Controls

Jump to solution

Hi Scott,

Apply the same formula as a "Rule" on "Material" control, it should work.

And I noticed the name of the control is "Material" and the function, fn-contains() refers it as "Material#", has Nintex added the "#" to the control name? Make sure the control name referred is correct in the fn-contains() function.

View solution in original post

0 Kudos
Reply
Scott22
Canvas Initiate

Re: Hide/Show a Controls

Jump to solution
Awesome! Thanks! That worked like a charm!
0 Kudos
Reply