Forum Discussion
Odata error when querying SAP SF ODATA API using PowerBI odata
I can query SAP SF using the below get request from Postman but cant query using the same using Power BI
| https://<API-Server>/odata/v2/PerPersonal?$filter=firstName like 'Ca%' or lastName like 'Ca%'&$select=firstName,lastName&$format=JSON |
Documentation of API :
Error:
Details: "OData: The feed's metadata document appears to be invalid. Error: The metadata document could not be read from the message content.
UnexpectedXmlAttribute : The attribute 'CollectionKind' was not expected in the given context. : (1, 1606986)
UnexpectedXmlAttribute : The attribute 'CollectionKind' was not expected in the given context. : (1, 2607067)
UnexpectedXmlAttribute : The attribute 'CollectionKind' was not expected in the given context. : (1, 2607837)
UnexpectedXmlAttribute : The attribute 'CollectionKind' was not expected in the given context. : (1, 2608134)
UnexpectedXmlAttribute : The attribute 'CollectionKind' was not expected in the given context. : (1, 2608656)
UnexpectedXmlAttribute : The attribute 'CollectionKind' was not expected in the given context. : (1, 2790133)
UnexpectedXmlAttribute : The attribute 'CollectionKind' was not expected in the given context. : (1, 4904745)
UnexpectedXmlAttribute : The attribute 'CollectionKind' was not expected in the given context. : (1, 4928270)
UnexpectedXmlAttribute : The attribute 'CollectionKind' was not expected in the given context. : (1, 4929056)
UnexpectedXmlAttribute..."Hi Anonymous ,
Would you please try to use web data source instead of OData feed? It seems that it will not work when you use odata for SAP SF based on my research.
Would you please try to create a new blank query and use something like:
let
Source = Json.Document(Web.Contents("https://apisalesdemo4.successfactors.com/odata/v2/User" & "?" & "$format=json", [Headers=[Authorization="Basic XXXXXXXXXXXXXXXXXXXXX"]])),
#"Converted to Table" = Record.ToTable(Source),
#"Expanded Value" = Table.ExpandRecordColumn(#"Converted to Table", "Value", {"results", "__next"}, {"Value.results", "Value.__next"})
in
#"Expanded Value"If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards,
Dedmon Dai
1 Reply
- v-deddai1-msftCommunity Support
Hi Anonymous ,
Would you please try to use web data source instead of OData feed? It seems that it will not work when you use odata for SAP SF based on my research.
Would you please try to create a new blank query and use something like:
let
Source = Json.Document(Web.Contents("https://apisalesdemo4.successfactors.com/odata/v2/User" & "?" & "$format=json", [Headers=[Authorization="Basic XXXXXXXXXXXXXXXXXXXXX"]])),
#"Converted to Table" = Record.ToTable(Source),
#"Expanded Value" = Table.ExpandRecordColumn(#"Converted to Table", "Value", {"results", "__next"}, {"Value.results", "Value.__next"})
in
#"Expanded Value"If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards,
Dedmon Dai