Question

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?

No correct solution

OTHER TIPS

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.

enter image description here

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top