OData functions are not working
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.
- ID: 916d6284-9149-5d95-48d8-40c60ba9f3c7
- Version Independent ID: 9c41a103-56d6-c186-26aa-ccd098a61f7e
- Content: Use OData query operations in SharePoint REST requests
- Content Source: docs/sp-add-ins/use-odata-query-operations-in-sharepoint-rest-requests.md
- Product: sharepoint
- GitHub Login: @VesaJuvonen
- Microsoft Alias: vesaj
Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.
@ashokghoghari please, remove $ before filter.
It should work then.
Removing $ before filter ignore my filter query.
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.
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.
@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 😊
@Tanddant I would if I could :)
@AJIXuMuK is this something that you can look into?