SharePoint 列表项上的 Orderby 不起作用不起作用、列表、SharePoint、Orderby

2023-09-07 09:06:12 作者:′ 给不了,你的明天。

我正在尝试使用 Microsoft Graph 订购一系列列表项:

I'm trying to order a collection of list items with Microsoft Graph :

.../items?select=id&orderby=id%20desc

我尝试了多个属性,并使用空格代替 %20.我遵循了文档.

I've tried on multiple properties and with a space instead of %20. I've followed the documentation.

但 id 总是按升序排列.我做错了什么还是 Microsoft Graph 的错误?

But ids are always ordered ascending. Am I doing anything wrong or is it a bug with Microsoft Graph ?

推荐答案

SharePoint 端点.目前仅支持 $select$expand$filter.

The $orderby parameter is not currently supported by the SharePoint endpoints. At this time only $select, $expand, and $filter are supported.

我建议访问 UserVoice 并添加对此功能的请求.在提取 ListItem 资源的集合时,它似乎很有价值.

I recommend visiting the UserVoice and adding a request for this feature. It seems like it would be valuable when pulling a collection of ListItem resources.

顺便说一句,您还缺少 $ 前缀:

As an aside, you're also missing the $ prefix:

items?$select=id&$orderby=id desc

仅在 beta 端点上支持忽略 $ 前缀.根据文档:

Ignoring the $ prefix is only supported on the beta endpoint. Per the documentation:

注意:在 beta 端点上,$ 前缀是可选的.

Note: On the beta endpoint, the $ prefix is optional.