How do you get a User object from Person or Group field value using JSOM/JavaScript API? I am looking for something like this (See Vadim Gremyachev answer), but let me be clear I DO NOT WANT the current logged in user as in that code example:
user = clientContext.get_web().get_currentUser();
I want a User object that is populated by a person or group field from a list column! The overall goal is to have a user object so I can do things like:
alert('The Display Name of the user is ' + user.get_loginName());
alert('The Account Name of the user is ' + user.get_id());
alert('The email address of the user is ' + user.get_email());
alert('The User Title is ' + user.get_title());
etc.
Also note in my scenario I am only using single user people picker fields so no complicated arrays or user collections needed when getting the value from the people picker field.
My current environment is:
SharePoint 2013 Enterprise On-premise