Current logged in user details

Dear @MehmetMuhanna,
As I've said, this depends on your setup, and there are other ways to retrieve user's email, for example, try this:

function updateCurrentUserInfo() {
    pnp.sp.profiles.myProperties.get().then(function(result) {

        var props = result.UserProfileProperties;
        console.log(props);
        for (var i = 0; i < props.length; i++) {
            switch (props[i].Key) {
                case 'WorkEmail':
                    fd.field('Title').value = props[i].Value;
                    break;
            }
        }
    });
}

fd.spRendered(function() {
    //executes updateCurrentUserInfo on form load
    updateCurrentUserInfo();
});
1 Like