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
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);
- Create a SharePoint list with a Person or Group column that allows multiple selections.
- Select at least one user whose email address is null or not populated.
- 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).
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
Additional environment details
Describe the bug / error
The request fails with the following error:
Cannot get value for projected field TeamMember_x005f_EMailThis 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.
Expected behavior
The query should return user details and handle users without an email address gracefully (e.g., return null for the email field).