1

With Graph Explorer, the following call works just fine.

https://graph.microsoft.com/v1.0/sites/contoso.sharepoint.com,964f1605-0c35-4e79-bc57-cd76f7a2ff7d,4e13a384-18bc-49c0-8f21-1a3f15c4dc63/lists/d136b6b0-69a3-4f58-9ec2-3056e149b86f/items?expand=fields

However, when making the call with select like below, it fails.

https://graph.microsoft.com/v1.0/sites/contoso.sharepoint.com,964f1605-0c35-4e79-bc57-cd76f7a2ff7d,4e13a384-18bc-49c0-8f21-1a3f15c4dc63/lists/d136b6b0-69a3-4f58-9ec2-3056e149b86f/items?expand=fields(select=id)

It returns:

"error": {
    "code": "-1, Microsoft.SharePoint.Client.InvalidClientQueryException",
    "message": "The expression \"fields(select\" is not valid.",
    "innerError": {
        "request-id": "eda74444-8c72-1111-90ea-26797ce181be",
        "date": "2020-03-18T11:11:11"
    }
}

What's wrong with the request?

Aaron
  • 11
  • 1
  • The 2nd request failed with the Graph Explorer preview. It works with non-preview Graph Explorer. – Aaron Mar 18 '20 at 23:17

2 Answers2

1

Use $expand=fields($select=id). The $ prefix is mandatory for v1.

AlfredoRevilla-MSFT
  • 3,171
  • 1
  • 12
  • 18
  • when using "$expand=fields($select=id)" I get " "code": "BadRequest", "message": "Parsing OData Select and Expand failed: Found an unbalanced bracket expression."" – Ofer Gal Jul 14 '20 at 13:56
  • @OferGal please provide request or correlation id and timestamp for the failed request. – AlfredoRevilla-MSFT Jul 14 '20 at 17:54
  • https://graph.microsoft.com/v1.0/sites/bae47d89-7e7d-40f2-b0cf-52ddb035adfa/Lists('User Information List')/items?expand=fields($select=id) returns "error": { "code": "-1, Microsoft.SharePoint.Client.InvalidClientQueryException", "message": "The expression \"fields($select\" is not valid.", "innerError": { "date": "2020-07-14T22:08:48", "request-id": "2cc746f3-e576-4a6c-a7bd-bfdfea184441" } } – Ofer Gal Jul 14 '20 at 22:11
1

Try replacing the = with %3D within the nested select. Seems like Graph Explorer doesn't like a naked = in brackets. Receiving 400s and 500s when attempting to get singleValueExtendedProperties

Dan Bennett
  • 1,450
  • 1
  • 15
  • 17