razvanhr
Nintex Newbie

How to hide a field in Forms 2013 based on the user being a specific user stored in the item

Hello everyone,

I am trying to wrap my head around a - seemingly - simple issue. I have the following scenario

Button A -> Show when current user is the same as a user stored in Person field P1, otherwise hide

Button B -> Show when current user is the manager of the current user, otherwise hide

In order to filter I want to get the Login Name (i:#...s\username etc. the claims id, you know what I mean) from a Person field e.g. P1 in my example. How do I do that?

(in order to check if someone is the current user I need to compare this to the claims ID because the variable Current User is in claims form as described above)

[rant] I have noticed that there is a very large inconsistency in the functioning of Nintex Forms formulas and functions: most of them return Display Names of users but take in Login Names. So...the "business power user" designing the form is supposed to know the difference right? And also where and exactly how to convert these... [/end rant]

0 Kudos
Reply
3 Replies
praios81
Nintex Newbie

Re: How to hide a field in Forms 2013 based on the user being a specific user stored in the item

Hey Razvan,

the first part should be straight forward to achieve.

I have a person field and a rule on my attachment control. If the person in my person field is the same as the current user, the attachment control hides:

The rule I used is Current User==Person where Person is the name of my people picker field.

I don't really get the second part. When is the current user the manager of the current user? Am I my own manager in this case?

You can however compare it, but need to reformat the current users account name:

userProfileLookup(Current User, "Manager")==userProfileLookup(Current User, "AccountName")

This will compare the account name of your current user's manager (domain\accountname) agains your current users account name (domain\accountname)

Hope this helps a bit.

Enrico

Reply
razvanhr
Nintex Newbie

Re: How to hide a field in Forms 2013 based on the user being a specific user stored in the item

Hello Enrico,

thanks for the reply, the part with the manager did work as you wrote!

However the Current User==Person rule did not work for me, it just shows the button for every user - probably ignoring the rule. This may be a bug in Forms. However I do not quite understand the logic of these rules - if the rule says "Hide the control if Current User == Person" then it would be the exact opposite of what I was trying to achieve -> to display the button ONLY when the Current User is the person in the field. So actually this should be not(Current User==Person) right? --> This does not work either! So I think I found a bug

Cheers

Razvan

0 Kudos
Reply
praios81
Nintex Newbie

Re: How to hide a field in Forms 2013 based on the user being a specific user stored in the item

Hey Razvan,

what value is shown when you put a calculated value control on your form and just make it write Current User and Person?

Is it the same format?

And yes you should be able to just put a "not()" around the validation to make it invert the output.

Best regards

Enrico

0 Kudos
Reply