Forum Discussion
Odata V4 Error. Couldn't parse OData response result.
I'm using OData V3 and V4 for retrieving data in Power BI Desktop.
I get the following error when trying to execute my Query from Power BI Desktop.
"DataSource.Error: We couldn't parse OData response result. Error: The context URI 'http://meta-ltp-yoga.metaphorix.co.uk:7048/DynamicsNAV100/ODataV4/$metadata#Collection(NAV.InventoryMovements)' is not valid for the expected payload kind 'Collection'.
Details:
DataSourceKind=OData
DataSourcePath=http://meta-ltp-yoga.metaphorix.co.uk:7048/DynamicsNAV100/ODataV4/Company('CRONUS%20UK%20Ltd.')/InventoryMovements.
If I retype "http://Meta-Ltp-Yoga.metaphorix.co.uk:7048/DynamicsNAV100/ODataV4/Company('CRONUS UK Ltd.')/InventoryMovements" into a browser data is returned correctly.
Can anyone advise where the problem might be? (OData V3 works fine).
8 Replies
- AnonymousNot applicable
Hi MikeSmallwood,
Based on error message, it mentioned invalid 'collection' variable in your query.
I don't think you can't direct use Odata V3 query in Odata V4.(it may contains some update for using parameter/variable)
I'd like to suggest your refer to the V4 document to create new query for this and try again.What’s New in OData Version 4.0
Regards,
Xiaoxin Sheng
- MikeSmallwoodFrequent Visitor
Hi Anonymous
Thanks for the response. I've looked at the documentation and my syntax looks OK. I'm struggling to apply any filter context inside an OData.Feed function.
Example
Let
OdataFeed4 = "http://Meta-Ltp-Yoga.metaphorix.co.uk:7048/DynamicsNAV100/ODataV4/Company('CRONUS UK Ltd.')/PurchaseOrders?$filter=Type eq 'Item'",
Source = OData.Feed(OdataFeed4)in
Source
The URL works fine in a browser.
Any further help would be much appreciated.
- AnonymousNot applicable
Hi MikeSmallwood,
I think you can try to use below formula, power query keywords are case sensitive, so you can't use 'Let' as start or the formula.
let OdataFeed4 = "http://Meta-Ltp-Yoga.metaphorix.co.uk:7048/DynamicsNAV100/ODataV4/Company('CRONUS UK Ltd.')/PurchaseOrders?$filter=Type eq 'Item'", Source = OData.Feed(OdataFeed4) in SourceRegards,
Xiaoxin Sheng