添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

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 Graph Orderby : Syntax error: character '%' is not valid at position 8 in 'lastUsed%2FlastAccessedDateTime desc'." #2316 Graph Orderby : Syntax error: character '%' is not valid at position 8 in 'lastUsed%2FlastAccessedDateTime desc'." #2316 raclettierer opened this issue Jun 13, 2022 · 4 comments · Fixed by #2318

Version

Please specify what version of the library you are using: [ V 3.3.2 ]

Please specify what version(s) of SharePoint you are targeting: [ V 1.14 ]

Expected / Desired Behavior / Question

When I request the lastUsed sites it works fine but when I add orderby I get an error. Maybe the lash escaping is wrong

message: "Syntax error: character '%' is not valid at position 8 in 'lastUsed%2FlastAccessedDateTime desc'."

Working
getGraph().me.insights.used.filter( ResourceVisualization/containerType eq 'Site' ).top(40)()

Error
getGraph().me.insights.used.filter( ResourceVisualization/containerType eq 'Site' ).top(40).orderBy(' lastUsed/lastAccessedDateTime ', false)();

Generated URL : https://graph.microsoft.com/v1.0/me/insights/used?$filter=ResourceVisualization/containerType eq 'Site'&$top=40&$orderby=lastUsed%2FlastAccessedDateTime desc

Observed Behavior

https://graph.microsoft.com/v1.0/me/insights/used?$filter=ResourceVisualization/containerType eq 'Site'&$top=40&$orderby=lastUsed/lastAccessedDateTime desc

Steps to Reproduce

you are awesome 😀

It works now and the url is now correct : ....$orderby=lastUsed/lastAccessedDateTime desc

Thx, Matthias