字段名称"_LikeCount and _CommentCount"在图形资源管理器中无法识别



你好,我试图查询最喜欢和评论的新闻在SharePoint SitePages然而,当试图使用_LikeCount和_CommentCount降序时,我收到了这个错误:

无法识别提供的字段名

。除了这两个字段,我对其他字段没有任何问题。

https://graph.microsoft.com/v1.0/sites/{ID}/lists/Site Pages/items?$filter=fields/PromotedState eq 2&expand=fields($select=createdDateTime,BannerImageUrl,PromotedState,FileLeafRef,AuthorLookupId,Modified,_CommentCount,_LikeCount,Title,Description,LinkTitle)&$top=5&$orderby=fields/_LikeCount desc

任何帮助都是感激的。谢谢!

在我看来,PromotedState字段名不被识别为有效的字段名,而且$orderby子句不支持按字段_LikeCount排序。

尝试在没有$filter$orderby的情况下运行查询以检查返回的字段

https://graph.microsoft.com/v1.0/sites/{ID}/lists/Site Pages/items?$expand=fields($select=createdDateTime,BannerImageUrl,PromotedState,FileLeafRef,AuthorLookupId,Modified,_CommentCount,_LikeCount,Title,Description,LinkTitle)&$top=5

使用$orderby

运行查询
https://graph.microsoft.com/v1.0/sites/{ID}/lists/Site Pages/items?$expand=fields($select=createdDateTime,BannerImageUrl,PromotedState,FileLeafRef,AuthorLookupId,Modified,_CommentCount,_LikeCount,Title,Description,LinkTitle)&$top=5&$orderby=fields/_LikeCount desc

它将返回invalidRequest错误。

使用$filter

运行查询
https://graph.microsoft.com/v1.0/sites/{ID}/lists/Site Pages/items?$expand=fields($select=createdDateTime,BannerImageUrl,PromotedState,FileLeafRef,AuthorLookupId,Modified,_CommentCount,_LikeCount,Title,Description,LinkTitle)&$filter=fields/PromotedState eq 2&$top=5

它将返回invalidRequest错误。

相关内容

最新更新