SharePoint 2013 Search Display Template People Search Mobile Phone

Hello,

I'd like to customize the people search result page. I already added some custom profile properties without any problem. But, when adding the MobilePhone field nothing is display.

  1. I've created a new display template based on the "Item_Person.html" file. 
  2. Added the "MobilePhone" field in the ManagedPropertyMapping section
<mso:ManagedPropertyMapping msdt:dt="string">&#39;WorkPhone&#39;:&#39;WorkPhone&#39;,&#39;MobilePhone&#39;:&#39;MobilePhone&#39;,&#39;Room&#39;:&#39;Room&#39;,&#39;Werkgebieden&#39;:&#39;Werkgebieden&#39;,&#39;AboutMe&#39;:&#39;AboutMe&#39;,&#39;AccountName&#39;:&#39;AccountName&#39;,&#39;BaseOfficeLocation&#39;:&#39;BaseOfficeLocation&#39;,&#39;Department&#39;:&#39;Department&#39;,&#39;HitHighlightedProperties&#39;:&#39;HitHighlightedProperties&#39;,&#39;Interests&#39;:&#39;Interests&#39;,&#39;JobTitle&#39;:&#39;JobTitle&#39;,&#39;LastModifiedTime&#39;:&#39;LastModifiedTime&#39;,&#39;Memberships&#39;:&#39;Memberships&#39;,&#39;PastProjects&#39;:&#39;PastProjects&#39;,&#39;Path&#39;:&#39;Path&#39;,&#39;PictureURL&#39;:&#39;PictureURL&#39;,&#39;PreferredName&#39;:&#39;PreferredName&#39;,&#39;Responsibilities&#39;:&#39;Responsibilities&#39;,&#39;Schools&#39;:&#39;Schools&#39;,&#39;ServiceApplicationID&#39;:&#39;ServiceApplicationID&#39;,&#39;SipAddress&#39;:&#39;SipAddress&#39;,&#39;Skills&#39;:&#39;Skills&#39;,&#39;UserProfile_GUID&#39;:&#39;UserProfile_GUID&#39;,&#39;WorkEmail&#39;:&#39;WorkEmail&#39;,&#39;WorkId&#39;:&#39;WorkId&#39;,&#39;YomiDisplayName&#39;:&#39;YomiDisplayName&#39;</mso:ManagedPropertyMapping>

3. Added a variable:

var has_MobilePhone = !$isEmptyString(ctx.CurrentItem.MobilePhone)

4. Copied the "WorkPhone" display section and changed the values to MobilePhone

<!--#_ 
                                        if(has_MobilePhone == true) {
_#-->
                                            <div id="MobilePhoneField">
<!--#_ 
                                                var encodedMobilePhone = ctx.CurrentItem.MobilePhone;
                                                var displayMobilePhone = Srch.U.getSingleHHXMLNodeValue(hhProps, "MobilePhone");
                                                if ($isEmptyString(displayMobilePhone)) { displayMobilePhone = encodedMobilePhone }
_#--> 
                                                <div id="MobilePhoneValue" class="ms-srch-ellipsis" title="_#= encodedMobilePhone =#_">MobilePhone: _#= displayMobilePhone =#_ </div>
                                            </div>
<!--#_ 
                                        }
_#-->

Unfortunally the mobilephone does not appear in my search results. 

What did I missed?

April 18th, 2014 6:07am

Property Name for Mobile Phone is CellPhone.

Check below link for name reference.

http://technet.microsoft.com/en-us/library/jj219630(v=office.15).aspx

Try adding CellPhone field in managed property mapping in display template and in all subsequent reference.

Thanks,

Avni Bhatt

Free Windows Admin Tool Kit Click here and download it now
April 18th, 2014 7:26am

First of all thank you for this quick reply.

I changed all the properties from MobilePhone to CellPhone, but without result.

<mso:ManagedPropertyMapping msdt:dt="string">&#39;WorkPhone&#39;:&#39;WorkPhone&#39;,&#39;CellPhone&#39;:&#39;CellPhone&#39;,&#39;Room&#39;:&#39;Room&#39;,&#39;Werkgebieden&#39;:&#39;Werkgebieden&#39;,&#39;AboutMe&#39;:&#39;AboutMe&#39;,&#39;AccountName&#39;:&#39;AccountName&#39;,&#39;BaseOfficeLocation&#39;:&#39;BaseOfficeLocation&#39;,&#39;Department&#39;:&#39;Department&#39;,&#39;HitHighlightedProperties&#39;:&#39;HitHighlightedProperties&#39;,&#39;Interests&#39;:&#39;Interests&#39;,&#39;JobTitle&#39;:&#39;JobTitle&#39;,&#39;LastModifiedTime&#39;:&#39;LastModifiedTime&#39;,&#39;Memberships&#39;:&#39;Memberships&#39;,&#39;PastProjects&#39;:&#39;PastProjects&#39;,&#39;Path&#39;:&#39;Path&#39;,&#39;PictureURL&#39;:&#39;PictureURL&#39;,&#39;PreferredName&#39;:&#39;PreferredName&#39;,&#39;Responsibilities&#39;:&#39;Responsibilities&#39;,&#39;Schools&#39;:&#39;Schools&#39;,&#39;ServiceApplicationID&#39;:&#39;ServiceApplicationID&#39;,&#39;SipAddress&#39;:&#39;SipAddress&#39;,&#39;Skills&#39;:&#39;Skills&#39;,&#39;UserProfile_GUID&#39;:&#39;UserProfile_GUID&#39;,&#39;WorkEmail&#39;:&#39;WorkEmail&#39;,&#39;WorkId&#39;:&#39;WorkId&#39;,&#39;YomiDisplayName&#39;:&#39;YomiDisplayName&#39;</mso:ManagedPropertyMapping>

var has_CellPhone = !$isEmptyString(ctx.CurrentItem.CellPhone)

<!--#_ 
                                        if(has_CellPhone == true) {
_#-->
                                            <div id="CellPhoneField">
<!--#_ 
                                                var encodedCellPhone = ctx.CurrentItem.CellPhone;
                                                var displayCellPhone = Srch.U.getSingleHHXMLNodeValue(hhProps, "CellPhone");
                                                if ($isEmptyString(displayCellPhone)) { displayCellPhone = encodedCellPhone }
_#--> 
                                                <div id="CellPhoneValue" class="ms-srch-ellipsis" title="_#= encodedCellPhone =#_">CellPhone: _#= displayCellPhone =#_ </div>
                                            </div>
<!--#_ 
                                        }
_#-->

Can you please tell me what I need to change?

April 18th, 2014 7:38am

Can you verify that you actually get the required cell phone managed property returned from Search Index, maybe with the help of: sp2013searchtool ?
Free Windows Admin Tool Kit Click here and download it now
April 30th, 2014 8:46am

Hi,

Have you made this one working? As i am going through the same issue, Please update the steps that make it work for you.

Thanks

May 21st, 2015 4:48am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics