Search code examples
restodata

Odata cant use filter. Why?


Why I cant use filter?

For example: need using this filter:

$filter=id eq 1

I use Graph Explorer for this.

https://graph.microsoft.com/v1.0/sites/volagas.sharepoint.com/sites/volagas.sharepoint.com,9a51e995-62f9-4b40-81c2-d167c4c79182,2646bdf6-214f-482c-826f-c5e21676a79c/lists/84885DBF-980E-4AD2-8377-AAB746E6D41A/items?$expand=fields&$select=id&$top=1

Response:

{
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#sites('site.sharepoint.com')/sites('site.sharepoint.com%2C9a51e995-62f9-4b40-81c2-d167c4c79182%2C2646bdf6-214f-482c-826f-c5e21676a79c')/lists('84885DBF-980E-4AD2-8377-AAB746E6D41A')/items(id,fields)",
    "@odata.nextLink": "https://graph.microsoft.com/v1.0/sites/site.sharepoint.com/sites/site.sharepoint.com,9a51e995-62f9-4b40-81c2-d167c4c79182,2646bdf6-214f-482c-826f-c5e21676a79c/lists/84885DBF-980E-4AD2-8377-AAB746E6D41A/items?$expand=fields&$select=id&$top=1&$skiptoken=UGFnZWQ9VFJVRSZwX0lEPTE",
    "value": [
        {
            "@odata.etag": "\"dfd2e718-5cac-4d7a-b8b3-7dba435dae29,12\"",
            "id": "1",
            "[email protected]": "https://graph.microsoft.com/v1.0/$metadata#sites('site.sharepoint.com')/sites('site.sharepoint.com%2C9a51e995-62f9-4b40-81c2-d167c4c79182%2C2646bdf6-214f-482c-826f-c5e21676a79c')/lists('84885DBF-980E-4AD2-8377-AAB746E6D41A')/items('1')/fields/$entity",
            "fields": {
                "@odata.etag": "\"dfd2e718-5cac-4d7a-b8b3-7dba435dae29,12\"",
                "Title": "тест_1_edited",
                "LinkTitleNoMenu": "тест_1_edited",
                "LinkTitle": "тест_1_edited",
                "ShipmentDateTime": "2018-11-29T21:00:00Z",
                "Good": "Нефть",
                "[email protected]": "#Single",
                "PricePerTon": 5000,
                "Contractor": "Данил Калинин",
                "CarNumber": "TESTCONTRACTOR_1",
                "TankNumber": "TESTCONTRACTOR_1",
                "DriverName": "TESTCONTRACTOR_1",
                "Status": "Бронь1",
                "_x0421__x0447__x0435__x0442_": "Выслать счет",
                "Payment": false,
                "id": "1",
                "ContentType": "Элемент",
                "Modified": "2018-11-29T05:54:46Z",
                "Created": "2018-11-26T11:03:29Z",
                "AuthorLookupId": "2211",
                "EditorLookupId": "2211",
                "_UIVersionString": "1.0",
                "Attachments": false,
                "Edit": "",
                "ItemChildCount": "0",
                "FolderChildCount": "0",
                "_ComplianceFlags": "",
                "_ComplianceTag": "",
                "_ComplianceTagWrittenTime": "",
                "_ComplianceTagUserId": "",
                "AppEditorLookupId": "61"
            }
        }
    ]
}

Every attempt returns a new error... With what it can be connected and how it can be corrected? Thanks in advance, looking forward to your reply.


Solution

  • The problem is solved, you need to use urlEncode and urlDecode if you use Cyrillic