Hide Panel If the Current User Is Not the Employee nor the Supervisor

  • 21 November 2018
  • 2 replies
  • 13 views

Badge +1

When using a Nintex Responsive form, I cannot get an OR rule for two conditions to work to hide a panel on a form. It may be because is is a user-based field for both conditions, but that's what I need, and I imagine this is common enough, but I just can't find anything that addresses it.

I would like, when editing the form, that only the form's named person (field is Name - Outlook) can see X panel, or only the form's named Supervisor can see X panel. I am using Item Properties for both Name - Outlook and Supervisor in my rule; however, I do not know if this matters, but Supervisor is a Named Control on the form, but for company-related reasons, the Name - Outlook is not a Named Control on the form. There is an Employee Named Control that is a drop-down list, and the name chosen on that list is tied to the Name - Outlook field, which is not on the form. We have to do that because there isn't always an employee but there is always a supervisor. 

My original formula to hide the panel in question is Current User (Display Name)!=Name - Outlook (Display Name)||Current User (Display Name)!=Supervisor (Display Name), which just ends up hiding the panel from everyone, regardless of who you are.

When I break that out as two separate rules and only have one active at a time, it works. If the Current User (Display Name)!=Name - Outlook (Display Name) is active, then the person who is logged in can see the panel on the form with their name, but the supervisor named on the form cannot see the panel. If the Current User (Display Name)!=Supervisor (Display Name) is the active rule, then the supervisor can see the panel on all the forms with their name on it, but the named employee cannot see that panel.

Any ideas would be greatly appreciated! Thank you!


2 replies

Userlevel 6
Badge +15

Hi there, 

I think you're close. You have this, and you say it hides the panel from everyone:

Current User (Display Name)!=Name - Outlook (Display Name) || Current User (Display Name)!=Supervisor (Display Name)

The only thing you need to change here is the || -- it needs to be an &&. 

I'll give you an example...

Let's say your Supervisor is Vadim Tabakman & your Employee is Euan Gamble

With your current form, if Euan came into the form, the form says "Oh ... It's Euan! He isn't Vadim. He IS Euan, though. I only need one of these values to be true because it's an OR, so I will hide this."

When we have an AND function (&&) in there instead, and Euan goes in, the form will go "Oh! It's Euan! He isn't Vadim ... but he IS Euan, and since both those pieces of logic aren't true, I won't do anything."

If I go into your form as a general viewer, the form will go "Oh! It's Rhia. She's not Vadim AND she's not Euan. Therefore, I will hide the form from her -- both those pieces of logic evaluated to true."

BOOM! Hidden form.

Cheers,

Rhia

 

Badge +1

You are amazing! So simple and totally worked.Thank you so much for taking the time to not only respond but also explain it so well. This is where my extensive Excel knowledge outs me as someone who is definitely not a programmer. Because of you, I will at least try the opposite of what I would have written in Excel. Again, thank you so much.

Reply