Get User Photo, Name &Title of an office 365 group using SPfx
-
08-02-2021 - |
문제
I am trying get the user details i.e. UserName, Title and Profile picture of users that belong to a office 365 distribution group.
I tried this code sample, but I get an undefined error:
msGraphClientFactory
is undefined.
export default class HelloWorldWebPart extends BaseClientSideWebPart<IHelloWorldWebPartProps> {
public render(): void {
// ...
this.context.msGraphClientFactory
.getClient()
.then((client: MSGraphClient): void => {
// use MSGraphClient here
});
}
// ...
}
Can someone suggest what I might be doing wrong or suggest an alternative to get the groups members and their user profile info like photo, name an title?
올바른 솔루션이 없습니다
다른 팁
Which version you're using?
As per the official documentation,
MSGraphClient is a new HTTP client introduced in SharePoint Framework v1.6.0 that simplifies connecting to the Microsoft Graph inside SharePoint Framework solutions.
I did test in my local environment with SharePoint Framework v1.8.2 and there is no such error.
제휴하지 않습니다 sharepoint.stackexchange