Question

I'm working on creating a People Directory for my SharePoint site. Instead of having to constantly going to My Sites to get everyone's info, I would create a simple table that would display contact info. I've been follow the SharePoint Config blog post about setting up a people directory. It does a really nice job of setting up a table view. The issue I'm having is that I want to change the information the table displays.

I have most majority of the table arranged the way I want it but I'm unable to get the Moblie Phone (CellPhone) numbers to appear in the list.

I modified the Managed Property Mapping

adding 'CellPhone':'CellPhone', to the list.

<mso:ManagedPropertyMapping msdt:dt="string">'AboutMe':'AboutMe','AccountName':'AccountName','BaseOfficeLocation':'BaseOfficeLocation','Department':'Department','CellPhone':'CellPhone','HitHighlightedProperties':'HitHighlightedProperties','Interests':'Interests','JobTitle':'JobTitle','LastModifiedTime':'LastModifiedTime','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>

I've added an if statement the will look for the Cell phone number then store it.

      ...
      var has_cell = !$isEmptyString(ctx.CurrentItem.CellPhone);
      ...
      if(has_cell == true){
      var encodedCell = ctx.CurrentItem.CellPhone;
      var displayCell = Srch.U.getSingleHHXMLNodeValue(hhProps, "CellPhone");
      if ($isEmptyString(displayCell)) { displayCell = encodedCell}
    }

Lastly I added cell phone to the table.

<td class="ms-vb2">_#=displayCell=#_</td>

I've gone to 5 of my users and added their Mobile Phone number in central admin, and no matter how many times I run any of the jobs related to users profiles it will not update on the table.

Can anyone tell me what I need to do to my code to get pull the user's mobile number?

Était-ce utile?

La solution

There are several things you have to check to be sure that you have configured the properties correctly.

  1. Is the User Profile property privacy setting "Everyone"? (If not the search security trimming will not show it.)
  2. Is the Managed Property Mapping in the Search Schema correct? (In my instance the People:CellPhone crawled property is mapped to MobilePhone not CellPhone.)
  3. Have you run a full people crawl since mapping the property and changing the User Profile values?
  4. Is your code logic correct? (I usually just use ctx.CurrentItem.MobilePhone)
Licencié sous: CC-BY-SA avec attribution
Non affilié à sharepoint.stackexchange
scroll top