Not sure what you mean – just use setFieldValue like this:
setFieldValue("Internal_name_of_people_picker", "Display name of user");
This will however NOT work if you have a comma in the user name – then you would have to get the login name like this:
function getUserByTitle(title){
var user = spjs.utility.queryItems({
"listName": "UserInfo",
"query": "<Where><Eq><FieldRef Name='Title' /><Value Type='Text'>User, Test</Value></Eq></Where>",
"viewFields": ["ID","Name"]
});
return user.count > 0 ? user.items[0] : null;
}
// Get the user like this:
var user = getUserByTitle("User, Test");
if(user !== null){
setFieldValue("Internal_name_of_people_picker", user.Name);
}
Alexander