Preventing a User Picker Field from allowing you to select the same user twice

I am using a User Picker Field in an interface and filtering the users by group. However the field allows me to select the same user multiple times.

Is there a way to remove a user from the dropdown field if they have already been selected?

 

I have found a way to prevent selecting a user multiple times, but it would be better if the user just didn't appear in the dropdown because they have already been selected.

  Discussion posts and replies are publicly visible

Parents
  • The only way I know of to prevent the same user from being selected twice in the native user picker is to use validations (which, judging from the last sentence in your post you're already doing). Preventing them from being displayed in the suggestions once they've been chosen isn't possible as far as I know. You can get around it by building instead a custom picker that accomplishes the same purpose, but with a suggest function that will filter already selected results. It will also allow you other additional controls over the behavior of the picker. The drawback there, however, is it will not look as nice as the default user picker since it won't have the same formatting or the user pictures.
Reply
  • The only way I know of to prevent the same user from being selected twice in the native user picker is to use validations (which, judging from the last sentence in your post you're already doing). Preventing them from being displayed in the suggestions once they've been chosen isn't possible as far as I know. You can get around it by building instead a custom picker that accomplishes the same purpose, but with a suggest function that will filter already selected results. It will also allow you other additional controls over the behavior of the picker. The drawback there, however, is it will not look as nice as the default user picker since it won't have the same formatting or the user pictures.
Children
No Data