public componentDidMount() {
this.props.context.msGraphClientFactory.getClient().then((client: MSGraphClient): void => {
    .get((error: any, eventsResponse, rawResponse?: any) => {
      if (error) {
        console.error("message is :" + error);
      const plannerTask: MicrosoftGraph.Event[] = eventsResponse.value;
      this.setState({ events: plannerTask });

Making an API call through Graph Explorer to fetch the Planner Task data into sharepoint webpart in the above function

i am getting an error when fetching the data of "{"Assignments : AssignedBy :User :id"}"

I am fetching data through Graph Explorer as shown below

enter image description here

I am able to fetch the {"CreatedBy : User :id"} but not able to fetch {"Assignments : AssignedBy :User :id"}

I have used that code to fetch the createdBy's ID and assignedBY's ID

{this.state.events.map((item, key) =>
              <td id="status">
                {(() => {
                  switch (item.percentComplete) {
                    case 0: return "Not-started";
                    case 50: return "In-Progress";
                    case 100: return "Completed";
              <td><a href={"https://tasks.office.com/credentinfotech.com/en-GB/Home/Planner#/plantaskboard?planId=" + item.planId + "&taskId=" + item.id} target="_blank" >{item.title}</a></td>
              <td>{moment(item.startDateTime).format('MM/DD/YYYY ')}</td>




Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.