nicktex
Scholar

People Picker - Revalidate to check for disabled users

Hi there,

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.

 

Cheers,

Nick

 

Default SharePoint people picker validation:

https://sharepoint.stackexchange.com/questions/239930/people-picker-validation

0 Kudos
Reply
5 Replies
kunalpatel
Collaborator

Re: People Picker - Revalidate to check for disabled users

@nicktex ....in a condition and in Run If action, there is an option to check if the person is valid in SharePoint or not, did you try to explore that?

Reply
nicktex
Scholar

Re: People Picker - Revalidate to check for disabled users

@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) 🙂

0 Kudos
Reply
Riley
Rookie

Re: People Picker - Revalidate to check for disabled users

I am running into the same issue where my users are disabled but is returning valid.

0 Kudos
Reply
nicktex
Scholar

Re: People Picker - Revalidate to check for disabled users

Are you including the domain is the check? I found just the username worked.
Test by using a Single Line text
0 Kudos
Reply
kunalpatel
Collaborator

Re: People Picker - Revalidate to check for disabled users

@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.

0 Kudos
Reply