none
SharePoint Online People Results page shows Account name instead of Display name of Manager

    Question

  • Hi,

    To show more fields on PeopleResults.aspx page we changed Item_Person.html and added Manager field using below technique. It is showing other fields correctly. However with Manage field it is showing account name instead of Display Name. Is there a way to show Display name instead of Account Name(Manager: i:0#.f|membership|<<AccountName@DomainName>>.com)? I am using below code.


    <mso:ManagedPropertyMapping msdt:dt="string">'AboutMe':'AboutMe','AccountName':'AccountName','BaseOfficeLocation':'BaseOfficeLocation','BusinessUnit':'BusinessUnit','BusinessUnitNumber':'BusinessUnitNumber','Department':'Department','EmployeeID':'EmployeeID','HitHighlightedProperties':'HitHighlightedProperties','Interests':'Interests','JobTitle':'JobTitle','LastModifiedTime':'LastModifiedTime','Manager':'Manager','Memberships':'Memberships','PastProjects':'PastProjects','Path':'Path','PictureURL':'PictureURL','PreferredName':'PreferredName','Responsibilities':'Responsibilities','Schools':'Schools','ServiceApplicationID':'ServiceApplicationID','SipAddress':'SipAddress','Skills':'Skills','UserProfile_GUID':'UserProfile_GUID','WorkEmail':'WorkEmail','WorkId':'WorkId','WorkPhone':'WorkPhone','YomiDisplayName':'YomiDisplayName'</mso:ManagedPropertyMapping>
    
    var has_manager = !$isEmptyString(ctx.CurrentItem.Manager);
    
    <!--#_ 
                                            if(has_manager == true) {
    _#-->
                                                <div id="ManagerField">
    <!--#_ 
                                                    var encodedManager = $htmlEncode(ctx.CurrentItem.Manager);
                                                    var displayManager = Srch.U.getSingleHHXMLNodeValue(hhProps, "manager");
                                                    if ($isEmptyString(displayManager)) { displayManager = encodedManager }
    _#--> 
                                                    <div id="ManagerValue" class="ms-srch-ellipsis" title="_#= encodedManager =#_"><b>Manager:</b> _#= displayManager =#_ </div>
                                                </div>
    <!--#_ 
                                            }

    Regards,

    Amit Chhatbar



    Thursday, April 20, 2017 1:10 PM

All replies