0

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?

1 Answer 1

0

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

1
  • Hi Lee, Can you share your solution on github , so that I can compare it with my solution. Oct 24, 2019 at 12:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.