I need to revalidate users that were previously entered into an item in a People Picker field. Otherwise if users that have since been disabled in AD will cause a workflow error when the permission workflow runs.
It seems the default SharePoint people field has a Validate() function (not much documentation on it though), but I *believe* I won't be able to select it in the form (like you can do with MM fields) as Nintex has created their own from scratch (which is why we have to use the NF PeoplePickerAPI)?
So far using JS I've been able to get the users from the field, and use the Nintex PeoplePickerAPI to search for the users. It seems if the AD account is enabled the returned id will be domain\username, and will include the claims part i:0#w|domain\username if they're disabled.
Using this I could display a message to the user (I'd rather not just remove them without notifying the user).
Seems a little bit hacky and potentially unreliable... does anyone know another way to do this? Is the SP People Picker field there in the background so I can jump on it and
But it would be ideal if there's a better way of doing it.
Default SharePoint people picker validation:
@kunalpatel yes thanks, I did look at that. Unfortunately it returns true even if the user in AD is disabled. I'm guessing as it's a valid SPUser.
Edit: actually, you made me look at it again... if I trim the sharepoint user string to remove the claims part so it's just 'Domain\Username' it validates against AD so that's good, thanks!
But ideally I'd revalidate the user/s in the form rather than when running the workflow (if possible) 🙂
@nicktex , what if you use calculated control and use like trim or replace function in it? Your claims part will be same so you can just try to replace it with blank.