User Profiles basically contain information (Manager, WorkEmail, workPhone,Department and etc.) about the person in the organization.

Create SharePoint Controls as mentioned below.
  1. Name (People or Person)
  2. E-Mail (Single Line of Text)
  3. Phone Number (Single Line of Text)
Add Script Editor webpart into NewForm.apsx page and write the below code into script editor webpart.

  1. <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
  2. <script type="text/javascript" src="/_layouts/15/SP.js"></script>
  3. <script type="text/javascript" src="/_layouts/15/SP.UserProfiles.js"></script>
  4. <script src="//cdnjs.cloudflare.com/ajax/libs/jquery.SPServices/2014.01/jquery.SPServices.min.js"></script>
  5. $(document).ready(function (){
  6. $("input:text").focus(function(){
  7. var userId = $("span.ms-entity-resolved").attr("ID"); // People Picker Reference
  8. userId=userId.replace(/\\/g,'\\');
  9. userId = userId.split("|")[1]; // Splitting User ID
  10. $().SPServices({
  11. operation: "GetUserProfileByName",
  12. async: false,
  13. AccountName: userId,
  14. completefunc: function (xData, Status) {
  15. workEmail = getUPValue(xData.responseXML, "WorkEmail"); //Fetching Email ID
  16. workPhone = getUPValue(xData.responseXML, "WorkPhone"); //Fetching Phone Number
  17. }
  18. });
  19. $("input[title='E-Mail']").val(workEmail); // Appending Email ID with TextField
  20. $("input[title='Phone Number']").val(workPhone); // Appending Phone Number with TextField
  21. });
  22. });
  23. function getUPValue(x, p) {
  24. var thisValue = $(x).SPFilterNode("PropertyData").filter(function() {
  25. return $(this).find("Name").text() == p;
  26. }).find("Values").text();
  27. return thisValue;
  28. }
In the below screen, EMail and Phone Field Values get auto populated onfocus of any control in the form.