Skip to content

Lookup Fields Missing in Results When Using renderListDataAsStream with CAML Query #10134

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
2 of 9 tasks
Zaker237 opened this issue Feb 28, 2025 · 3 comments
Open
2 of 9 tasks
Assignees
Labels
sharepoint-developer-support sharepoint-developer-support type:bug-suspected Suspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs.

Comments

@Zaker237
Copy link

Target SharePoint environment

SharePoint Online

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

SharePoint REST API

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
  • SPFx version
  • Node.js version
  • etc

Describe the bug / error

I'm encountering an issue since 5 days when querying a SharePoint calendar list via the REST API using the PnP JS library's renderListDataAsStream method. Even though I've included the lookup field explicitly in the section of my CAML query and verified that the internal name is correct, the lookup field is not returned in the response.

Steps to reproduce

Setup:

  • Use a calendar list with recurring events.
  • Ensure the list contains at least one lookup field (e.g., "Employee") linked to another list.

Execute the Query:

Construct a CAML query with OverrideViewXml that includes:

  • A section explicitly listing the lookup field.
  • A section filtering recurring events using and a with a dynamically generated date.
  • with and set.

Set the Paging parameter to "Paged=TRUE".

Example CAML Query:

<View>
  <ViewFields>
    <FieldRef Name="Title" />
    <FieldRef Name="LookupFieldInternalName" />
  </ViewFields>
  <Query>
    <Where>
      <DateRangesOverlap>
        <FieldRef Name='EventDate' />
        <FieldRef Name='EndDate' />
        <FieldRef Name='RecurrenceID' />
        <Value Type='DateTime' IncludeTimeValue='TRUE'>
          ${dateValue.toISOString()}
        </Value>
      </DateRangesOverlap>
    </Where>
  </Query>
  <RowLimit>2000</RowLimit>
  <QueryOptions>
    <ExpandRecurrence>TRUE</ExpandRecurrence>
    <CalendarDate>${dateValue.toISOString()}</CalendarDate>
  </QueryOptions>
</View>

Observation:

The query successfully returns recurring event items.
However, the lookup field (Employee) is consistently missing from the returned data, even though it's defined in the .

Expected behavior

The lookup field should be included in the results alongside other fields (e.g., Title).

@Zaker237 Zaker237 added the type:bug-suspected Suspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs. label Feb 28, 2025
@Zaker237
Copy link
Author

the dateValue in my xml query is declared as following

const dateValue = new Date();

@ChetanSharma-msft
Copy link

Hello @Zaker237 - Thanks for raising your query.
We will look into it and let you know the updates.

@Ashlesha-MSFT Ashlesha-MSFT self-assigned this Mar 4, 2025
@Ashlesha-MSFT Ashlesha-MSFT added the sharepoint-developer-support sharepoint-developer-support label Mar 10, 2025
@Amey-MSFT
Copy link

Hello @Zaker237 ,
The Paged=TRUE paging parameter is mentioned but not properly included in the CAML query's .
So can you check if it included properly so the steps can be reproduced.
Thanks!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sharepoint-developer-support sharepoint-developer-support type:bug-suspected Suspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs.
Projects
None yet
Development

No branches or pull requests

4 participants