I have a custom content type that has a users: entity reference autocomplete field. For some reason the list gets populated as [realname] ([name]). In other words the realname and username tokens are both shown in the autocomplete list. Is there a way to only show the realname token?

I would like to go from this... Current Entity Reference as Autocomplete field

To this Desired Entity Reference as Autocomplete field

1 Answer 1


Set up a view for the autocomplete.

You can use this tutorial: http://speaksdrupal.com/blog/custom-entityreference-handlers-using-views

Then add that as the view to use for autocomplete.


Whatever fields are searched will show up in the drop down. So if you remove e-mail from the list of fields searched, it won't show up in the drop-down.

  • thanks!! worked great... just have to remember to change the view's default access permissions otherwise it seems to not change the rendered entity reference for anonymous users!!
    – John R
    Commented Sep 19, 2014 at 16:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.