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

detect autocomplte in peoplePicker

I want to listen to choosing a person at the peoplePicker - in order to start the form only after he has written his name.

How can I do it?

0 Kudos
Reply
7 Replies
Automation Master
Automation Master

Re: detect autocomplte in peoplePicker

could you explain your business case in more details?

if you're populating a people control you already have to be in forms, what other form would you like to start?

0 Kudos
Reply
eyalseg
Nintex Newbie

Re: detect autocomplte in peoplePicker

I am talking about show or hide controls according a function I make on the code.

0 Kudos
Reply
Automation Master
Automation Master

Re: detect autocomplte in peoplePicker

sorry, still no clue what you're trying to do/achieve...

0 Kudos
Reply
eyalseg
Nintex Newbie

Re: detect autocomplte in peoplePicker

IO want to check if user on the prople picker exists on other list.

When usding a rule of lookup - checking if user is exist at other list (not specking about the need for finding him in a specific  view), and show or hide controls take a lot of time.

a good solution that wiorks fast is using ajax when the user has changed the value or just select at the people picker.

The only problem is that I don't detect it by click- choosing of a person,  but ust on "blur" and it's not enough

0 Kudos
Reply
Automation Master
Automation Master

Re: detect autocomplte in peoplePicker

using lookup() function the easiest/most straightforward way.

see eg. https://community.nintex.com/message/77277-re-can-i-lookup-a-person-in-a-table-based-on-a-people-pic... 

how big is your other list if you say it's slow?

have you got it indexed?

0 Kudos
Reply
eyalseg
Nintex Newbie

Re: detect autocomplte in peoplePicker

I am sorry but it is slowly and demand other column in order  to check if the item is exist in one view or not (because lookout is not with view). 
Therefore there are 2 conditions to check - and it become very slow: something like 2 seconds for 600 items list!

0 Kudos
Reply
Automation Master
Automation Master

Re: detect autocomplte in peoplePicker

I'd recommend to focus on that performance issue first. if such a simple lookup is slow soon or later you will experience performance issues elsewhere

but ok. to capture click events on people picker control try following code

NWF.FormFiller.Events.RegisterAfterReady(function () {
          (new NF.PeoplePickerApi('#'+PPControl)).added(function(){
             NWF$('#'+PPControl ).siblings('div.ip-item:last').click(function(){
                 //fires when clicked on people picker control entry
                 console.log('click ip-tem')
             });
          });
          
          NWF$('#'+PPControl ).siblings('textarea.ip-input').click(function(){
              //fires when clicked in people picker control input box
              console.log('click ip-input');
          });
});

‌ people entry‌

0 Kudos
Reply