cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Nintex Newbie

Rule for People Picker

Jump to solution

Hi,

I have another question, how to add a rule on people picker?

for example if I choose Individual Nominee , the people picker field should allow user to all only one person.

If I choose Team Nomination then the people picker should allow multiple users names.

Thanks In Advance

Labels: (1)
0 Kudos
Reply
14 Replies
Highlighted
Automation Master
Automation Master

Re: Rule for People Picker

Jump to solution

it's not possible to restrict people picker control to dynamically change at runtime number of allowed entries.

you can however write a validation rule that could check whether single person or team is selected along with number of entries in people picker control.

have a look on following post how to determine number of entreis in people picker control https://community.nintex.com/message/62289-re-people-picker-field-validation?commentID=62289#comment... 

0 Kudos
Reply
Highlighted
Automation Master
Automation Master

Re: Rule for People Picker

Jump to solution

While you cannot restrict the Maximum Entries value on the control during runtime, you can certainly validate against it. 

If you have two (2) controls

Choice Control

   Options:

  1. Individual
  2. Team

Name: target_group

People Picker

   Required: Yes

   Maximum Entries: 25

   CSS class: myPeoplePicker

   Name: target_selector

You'll be able to use the following rule to throw a validation error when you have selected Individual on the Choice Control and more than one (1) entree for the People Picker Control. 

(target_group === "Individual" && NWF$(".myPeoplePicker .ip-item").length > 1);

The results should be as follows: 

Individual selection + more than (1) entry will fail.

But a Team selection passes the test

I hope this helps. 

View solution in original post

Reply
Highlighted
Nintex Newbie

Re: Rule for People Picker

Jump to solution

Than you Very much !!!! that really made magic

0 Kudos
Reply
Highlighted
Automation Master
Automation Master

Re: Rule for People Picker

Jump to solution

Ah! Excellent! Great to hear! 

0 Kudos
Reply
Highlighted
Nintex Newbie

Re: Rule for People Picker

Jump to solution

HI,

 All of a sudden this rule is not working on my form any more.

 what could go wrong?

could you please let me know?

Thanks,

Rama.

0 Kudos
Reply
Highlighted
Automation Master
Automation Master

Re: Rule for People Picker

Jump to solution

Out of curiosity, which version of SharePoint are you using?

I can't evaluate it right now, but should be able to do some testing later tonight. 

0 Kudos
Reply
Highlighted
Nintex Newbie

Re: Rule for People Picker

Jump to solution

SharePoint 2013

0 Kudos
Reply
Highlighted
Automation Master
Automation Master

Re: Rule for People Picker

Jump to solution

And is there any particular strange behavior that is happening other than that it is no longer working?

As in, it works with Individual but not Group, or the other way around, or neither? 


0 Kudos
Reply
Highlighted
Nintex Newbie

Re: Rule for People Picker

Jump to solution

No!! I have applied it only for individual nominee( like if user click individual and put more than 1 person in people picker then the validation rule should be applied).

Now, the form is not validating any more.

The strange thing I notice is.. when I figured the validation rule is not working any more I tried to pull the older version of the form ( where my validation rule for the people picker field is working) and checked it is not working either!

Please let me know if I explained clearly.

Thanks,

Rama.

0 Kudos
Reply