利用pnp获取用户的property

//Retrieve Properties of Current User
$pnp.sp.profiles.myProperties.get().then(function(result) {
    props = result.UserProfileProperties.results;
    var propValue = "";
    props.forEach(function(prop) {
        propValue += prop.Key + " - " + prop.Value + "<br/>";
    });
    document.getElementById("sample").innerHTML = propValue;
}).catch(function(err) {
    console.log("Error: " + err);
});
//获取特定人员的property
$pnp.sp.profiles.getPropertiesFor(loginName).then(function(result) {
    var props = result.UserProfileProperties.results;
    var propValue = "";
    props.forEach(function(prop) {
    propValue += prop.Key + " - " + prop.Value + "<br/>";
    });
}).catch(function(err) {
    af.error("Submission failed: " + err);
});

 

posted on 2019-03-07 15:04  赢在当下_Victor  阅读(214)  评论(0编辑  收藏  举报

导航