Skip to content
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

renderListDataAsStream return unknown error when filtering a large date range #3186

Closed
quantrpeter opened this issue Jan 3, 2025 · 4 comments

Comments

@quantrpeter
Copy link

Major Version

4.x

Minor Version Number

4.0.0

Target environment

SharePoint Framework

Additional environment details

I am trying to call renderListDataAsStream with filtering a date time field, if the date range is narrow, such as 10 days, then it returns items. If the date range is large, such as few months, it return error:

parsers.js:95 Uncaught (in promise) HttpRequestError: Error making HttpClient request in queryable [500] ::> {"odata.error":{"code":"-1, Microsoft.SharePoint.Client.UnknownError","message":{"lang":"en-US","value":"Unknown Error"}}}
at HttpRequestError.init (parsers.js:95:1)
at async Proxy.errorCheck (parsers.js:44:1)
at async queryable.js:120:1

image

Expected or Desired Behavior

returning the document library items

Observed Behavior

the restful api returning error

Steps to Reproduce

		const response = await this.sp.web.lists.getByTitle(listTitle).renderListDataAsStream(
			{
				ViewXml: `<View>
									<Query>
										<Where>                                            
										   <And>                            
										      <Geq>                                
										           <FieldRef Name='InvDate'/>                                
										           <Value Type='DateTime'>2023-01-01T00:00:00Z</Value>                            										      										     										      </Geq>
                                                                                     <Leq>
										           <FieldRef Name='InvDate'/>
										          <Value Type='DateTime'>2025-01-02T00:00:00Z</Value>                            
										      </Leq>
										    </And>
										</Where>    
										<OrderBy>
											<FieldRef Name="${sortField}" Ascending='${ascending}'/>
										</OrderBy>
									</Query>
									<ViewFields>
										<FieldRef Name='FileLeafRef'/>
										<FieldRef Name='InvDate'/>
										<FieldRef Name='InvNumber'/>
										<FieldRef Name='CustomerName'/>
										<FieldRef Name='LocationCode'/>
										<FieldRef Name='Modified'/>
										<FieldRef Name='Modified_x0020_By'/>
										<FieldRef Name='Global_x0020_Tags'/>
										<FieldRef Name='Department_x0020_Tags'/>
										<FieldRef Name='Global_x005f_x0020_x005f_Tags'/>
										<FieldRef Name='Department_x005f_x0020_x005f_Tags'/>
										<FieldRef Name='Editor'/>
										<FieldRef Name='UniqueId'/>
									</ViewFields>
					 				<RowLimit Paged="TRUE">100</RowLimit>
					 			</View>`,
			},
			{ RootFolder: `/sites/DMS/${this.parentFolder}` }
@juliemturner
Copy link
Collaborator

The error your showing is from SharePoint API. As we mention in our docs this library is only a passthru to the Microsoft Graph and SharePoint apis and as such if you're seeing a 500 error in the console, then that's an issue with the api and not one we can solve. There may be something you can do to get around the error, but I'm not sure what.

@patrick-rodgers
Copy link
Member

To echo Julie's point, this is the service returning the error - nothing in the library. Based on the information provided you're broad query may be returning too many entries and is causing an error, possibly the 5000 item limit. You could use paging queries or keep the tighter filtering.

If you can share more about your scenario perhaps we can provide better guidance.

@juliemturner
Copy link
Collaborator

I'm going to close this issue as answered. If you have further issues, please feel free to create a new issue and reference this one.

Copy link

This issue is locked for inactivity or age. If you have a related issue please open a new issue and reference this one. Closed issues are not tracked.

@github-actions github-actions bot locked and limited conversation to collaborators Jan 18, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants