Skip to content

Person or Group column throws error when selected user has null email #10562

@bhoomesh-spe

Description

@bhoomesh-spe

Target SharePoint environment

SharePoint Online

What SharePoint development model, framework, SDK or API is this about?

💥 SharePoint Framework

Developer environment

Windows

What browser(s) / client(s) have you tested

  • 💥 Internet Explorer
  • 💥 Microsoft Edge
  • 💥 Google Chrome
  • 💥 FireFox
  • 💥 Safari
  • mobile (iOS/iPadOS)
  • mobile (Android)
  • not applicable
  • other (enter in the "Additional environment details" area below)

Additional environment details

  • browser version - 143.0.7499.170
  • SPFx version - 1.21.1
  • Node.js version - 22.14.0

Describe the bug / error

The request fails with the following error:

Cannot get value for projected field TeamMember_x005f_EMail

This issue prevents retrieving list data when any selected user does not have an email address, impacting scenarios where service accounts, guest users, or incomplete profiles are used.

Steps to reproduce

We have created a Person or Group column in a SharePoint list that allows multiple user selections.

While retrieving list items using PnPjs, the query works correctly when all selected users have an email address.

However, if any selected user does not have an email populated, the request fails with an error.

import { spfi, SPFx } from "@pnp/sp";
import "@pnp/sp/lists";
import "@pnp/sp/items";
import "@pnp/sp/site-users/web";

const sp = spfi().using(SPFx(this.context));

const items = await sp.web.lists
  .getByTitle("Projects")
  .items.select(
    "Id",
    "Title",
    "TeamMember/Id",
    "TeamMember/Title",
    "TeamMember/EMail"
  )
  .expand("TeamMember")();

console.log(items);
  1. Create a SharePoint list with a Person or Group column that allows multiple selections.
  2. Select at least one user whose email address is null or not populated.
  3. Execute the above PnPjs query to retrieve list items.

Expected behavior

The query should return user details and handle users without an email address gracefully (e.g., return null for the email field).

Metadata

Metadata

Assignees

Labels

sharepoint-developer-supportsharepoint-developer-supporttype:bug-suspectedSuspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions