The Problem

Suppose you have the following:

a. A form with a dropdown linked to a list of approvers for the user to select.

b. When the user selects the approver, you want to populate a hidden people picker control.

c. You attach this people picker control to an site column of type ‘Person’.

d. You then use this site column in your Nintex workflow to assign a Flexi-Task for the approver.

However, if the users are quick enough you may end up submitting your form before the People Picker control is populated successfully. This leaves your field empty and will error out your Nintex Workflow.

The Fix

The fix here is to ensure you only enable the submit button after the people picker control has populated successfully.


var ppApprover = new NF.PeoplePickerApi('#'+ppSelectedApprover);
ppApprover.clear();

ppApprover.search(data.loginID).done(function (data) {

		  ppApprover.add(data[0]);
		  selectedApproverName.val(pickedName);
		  NWF$(".ApproverLoadingImage")[0].style.display= "none";
		  NWF$(".submitButton").prop("disabled", false);

		  NWF.FormFiller.Functions.ProcessOnChange(selectedApproverName);
});     

Here, data.loginID stores the approver’s AD login id.

This is used by the People Picker’s internal logic to search for the selected user.

Hope this helps!