SharePoint / sp-dev-docs

SharePoint & Viva Connections Developer Documentation
https://docs.microsoft.com/en-us/sharepoint/dev/
Creative Commons Attribution 4.0 International
1.24k stars 1k forks source link

OData functions are not working #8323

Open ashokghoghari opened 2 years ago

ashokghoghari commented 2 years ago

Hi, I am trying to use the OData function in power automation and getting below error.

Error: status":400, message:"The query is not valid.

Filter query. https://{MySP}.sharepoint.com/_api/web/lists/getbytitle('{MyListName}')/Items?$filter=day(Birthday) eq 20 and month(Birthday) eq 7

Please help me to figure it out.

[Enter feedback here]


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

ghost commented 2 years ago

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

AJIXuMuK commented 2 years ago

@ashokghoghari please, remove $ before filter. It should work then.

ashokghoghari commented 2 years ago

Removing $ before filter ignore my filter query.

JeremyKelley commented 2 years ago

Is Birthday an actual property name on the objects returned in the Items collection? If Birthday is the name of a column in the list I'm not sure if we support a syntax to let you filter on a specific field easily.

garrytrinder commented 1 year ago

Related to #5481 which was closed due to no activity. There are more examples given in this issue of OData date functions not working as per the documentation.

The day(), month(), year(), hour(), minute(), second() functions are stated as supported in the docs, see
https://learn.microsoft.com/en-us/sharepoint/dev/sp-add-ins/use-odata-query-operations-in-sharepoint-rest-requests#odata-query-operators-supported-in-the-sharepoint-rest-service, but there are no examples given of how to use them correctly.

Tanddant commented 10 months ago

@garrytrinder - Are we able to look into this? - I've never seen them used either, but have a use-case where they would be 🔥 - but judging from the threads here, the docs are simply outdate/wrong, would be awesome with a clarification 😊

garrytrinder commented 9 months ago

@Tanddant I would if I could :)

@AJIXuMuK is this something that you can look into?