1

I am trying to show which user profile properties the users are missing to fill out. It is fairly easy to get the usersprofile, and userprofile properties:

function getUserPropertiesFromProfile() {
// Get the current client context and PeopleManager instance.
var clientContext = new SP.ClientContext.get_current();
var peopleManager = new SP.UserProfiles.PeopleManager(clientContext);

// Get user profile properties for the current user
userProfileProperties = peopleManager.getMyProperties();

// Load the UserProfilePropertiesForUser object and send the request.
clientContext.load(userProfileProperties);
clientContext.executeQueryAsync(onProfileRequestSuccess, onProfileRequestFail);
}

function onProfileRequestSuccess() {
    var propertyValue = userProfileProperties.get_userProfileProperties()["SPS-JobTitle"];
    if (propertyValue === undefined) {
        // Property is not present in your User Profile Service Application
    } 
    else if (propertyValue === "") {
        // Property is empty
    }

}

function onProfileRequestFail() {
    // Handle failure
} 

But my problem is that it is the internal name i get, and not the external. For example "Job Title" is "SPS-JobTitle". So what i want is that if the "SPS-JobTitle" is empty or undefined, then i want to write the external name = "Job Title" out to the user.

Is is possible? I know it is easy in SSOM (example the ProfileSubtypeManager).

0 Answers0