OlivierCC / spfx-40-fantastics

This package is a sample kit of Client Side Web Parts built on the SharePoint Framework SPFx. You can find here different kind of high visual web parts as carousel, images galleries, animations, map, editors, etc.
MIT License
412 stars 277 forks source link

Diplay user profile properties using SPFX webpart #50

Open mparomitaaa opened 7 years ago

mparomitaaa commented 7 years ago

Hi

I am using the library "sp-client-custom-fields" licensed by MIT to use the SharePoint People Picker control in a SPFX webpart. I am able to use the code successfully to pull some of the property values using the available codebase. However, my requirement is to display some custom users properties when users select a specific user from the people picker but I am not able to show the values from any other profile properties. I wanted to create my own library on top of the MIT one but I was not able to do that. The available codebase shows the username, email id, designation and profile picture only. Please provide a solution to display other custom properties as well. PropertyFieldPeoplePickerHost.js file is the one that's populating the user profile property values and I am trying to understand the entitydata from the below code snippet - kindly help- return _this.context.spHttpClient.post(userRequestUrl, sp_http_1.SPHttpClient.configurations.v1, httpPostOptions).then(function (searchResponse) { return searchResponse.json().then(function (usersResponse) { var res = []; var values = JSON.parse(usersResponse.value); values.map(function (element) { var persona = { fullName: element.DisplayText, login: element.Description }; persona.email = element.EntityData.Email; persona.jobTitle = element.EntityData.Title; persona.initials = _this.getFullNameInitials(persona.fullName); persona.imageUrl = _this.getUserPhotoUrl(persona.email, _this.context.pageContext.web.absoluteUrl); res.push(persona); }); return res; Thank you !!

Thanks and regards Paromita