Hello Community!
I'm working in SharePoint 2013 creating an Employee Directory using People Search following the article below:
https://help.insight.com/app/answers/detail/a_id/117
I've created a custom Search Result Type and I've included a number of User Profile Properties that I know are populated in the User Profiles (I've checked several individual properties). However, while some of the User Properties are displaying just fine, others, while populated in the Profiles, are not displaying, specifically 'Office" and 'Company'.
Here are my managed property mappings (returns added for usability):
<mso:ManagedPropertyMapping msdt:dt="string">'AboutMe':'AboutMe','AccountName':'AccountName', 'BaseOfficeLocation':'BaseOfficeLocation','Company':'Company', 'Department':'Department','HitHighlightedProperties':'HitHighlightedProperties', 'HomePhone':'HomePhone','Interests':'Interests','JobTitle':'JobTitle', 'LastModifiedTime':'LastModifiedTime','Memberships':'Memberships', 'Office':'Office','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>
Here are my variables:
var has_cn = !$isEmptyString(ctx.CurrentItem.Company); var has_off = !$isEmptyString(ctx.CurrentItem.Office);
Here is my display code:
<!--#_
if(has_cn == true) {
_#--><div id="Company"><!--#_
var encodedCompany = $htmlEncode(ctx.CurrentItem.Company);
var displayCompany = Srch.U.getSingleHHXMLNodeValue(hhProps, "company");
if ($isEmptyString(displayCompany)) { displayCompany = encodedCompany }
_#--> <div id="CompanyValue" class="ms-srch-ellipsis" title="_#= encodedDept =#_">Company: _#= displayCompany =#_ </div></div><!--#_
}
_#--><!--#_
if(has_off == true) {
_#--><div id="Office"> <!--#_
var encodedOff = $htmlEncode(ctx.CurrentItem.Office);
var displayOff = Srch.U.getSingleHHXMLNodeValue(hhProps, "Office");
if ($isEmptyString(displayOff)) { displayOff = encodedOff }
_#--> <div id="BLocValue" class="ms-srch-ellipsis" title="_#= encodedDept =#_">Work Location: _#= displayOff =#_ </div></div><!--#_
}
_#-->I also checked the Property Settings for those Profile Properties and they are correct.
Has anyone else seen this issue? If so please provide guidance and code examples.
Thanks!
Tom
Tom Molskow - Senior SharePoint Architect - Microsoft Community Contributor 2011 and 2012 Award - Linked-In - SharePoint Gypsy