Forum Discussion

Watever's avatar
Watever
Frequent Visitor
1 year ago
Solved

Power Query OData Top and Filter not working ?

I have a sharepoint list that eventually will grow large.

But for my query (in an excel file), I only need to work with the last 30 days or last 200 items for a specific column value.

 

Unfortunately, any filter or order or top doesn't work. I don't understand why.

If I do a web query on the same parameters, it work.

 

let

Source =
OData.Feed(
"https://tenant.sharepoint.com/sites/SharepointName/_api/web/Lists/GetByTitle('List_Name')/Items",
null,
[
Implementation = "2.0",
Query = [
filter = "Receiving_Site eq 'ABCD'",
orderby = "Id desc",
top = "2"
]
]
),

 

But this works :
https://tenant.sharepoint.com/sites/SharepointName/_api/web/Lists/GetByTitle('List_Name')/Items?$filter=Receiving_Site %20eq%20%27ABCD%27&$orderby=Id%20desc&$top=2

 

 

What am I doing wrong or missing ?

5 Replies