you can do it using a simple below code ;you will have to get the contact fields from regarding and set it on to field :
SetPartyList: function (contactId, customerName, cEmail) {
var partyRequired = Xrm.Page.getAttribute("to");
// Create new array
var partlist = new Array();
partlist[0] = new Object();
partlist[0].id = contactId; //Guid (i.e., Guid of User or Contact etc)
partlist[0].name = customerName; //Name (i.e., Name of User or Contact etc)
//partlist[0].EMailAddress1 = cEmail;
partlist[0].entityType = "contact"; //entity schema name of account or contact
// Set array value
partyRequired.setValue(partlist);
},
getContactEmail: function () {
// Call this function from CRM Form Attribute OnChange
//RSA.Email.getContactEmail
try {
if (Xrm.Page.getAttribute("to").getValue() != null)
return;
//var accountId = window.top.opener.top.opener.Xrm.Page.data.entity.getId();
var id = Xrm.Page.getAttribute("regardingobjectid").getValue()[0].id;
var contactId = id.slice(1, -1);
var serverUrl;
if (Xrm.Page.context.getClientUrl !== undefined) {
serverUrl = Xrm.Page.context.getClientUrl();
}
else {
serverUrl = Xrm.Page.context.getServerUrl();
}
var ODataPath = serverUrl + "/XRMServices/2011/OrganizationData.svc";
var contactRequest = new XMLHttpRequest();
contactRequest.open("GET", ODataPath + "/ContactSet(guid'" + contactId + "')", false);
contactRequest.setRequestHeader("Accept", "application/json");
contactRequest.setRequestHeader("Content-Type", "application/json; charset=utf-8");
contactRequest.send();
//If request was successful, parse the email address
if (contactRequest.status == 200) {
var retrievedContact = JSON.parse(contactRequest.responseText).d;
var cEmail = retrievedContact.EMailAddress1;
var cName = retrievedContact.FullName;
SetPartyList(contactId, cName, cEmail);
//cEmail != null ? Xrm.Page.getAttribute('to').setValue(cEmail) : '';
}
else {
console.log('request failed.');
}
Xrm.Page.getAttribute('to').setSubmitMode("always");
}
you can take a reference from it and use web api in between to retrieve the values from contact.
mark my answer as verified if helpful