Sample Data
Sample data retrieved from an OData REST API connection showing user IDs, names, and countries.
| Cell | Value |
|---|---|
| A1 | ID |
| B1 | Name |
| C1 | Country |
| A2 | 101 |
| B2 | Alice |
| C2 | USA |
| A3 | 102 |
| B3 | Bob |
| C3 | Canada |
| A4 | 103 |
| B4 | Charlie |
| C4 | UK |
Sample data retrieved from an OData REST API connection showing user IDs, names, and countries.
| Cell | Value |
|---|---|
| A1 | ID |
| B1 | Name |
| C1 | Country |
| A2 | 101 |
| B2 | Alice |
| C2 | USA |
| A3 | 102 |
| B3 | Bob |
| C3 | Canada |
| A4 | 103 |
| B4 | Charlie |
| C4 | UK |
OData.Feed("https://services.odata.org/V4/Northwind/Northwind.svc/Customers")A B C 1 ID Name Country 2 101 Alice USA 3 102 Bob Canada 4 103 Charlie UK
A B C 1 ID Name Country 2 101 Alice USA 3 102 Bob Canada 4 103 Charlie UK
OData connection in Power BI compared to a generic REST API?Web.Contents() function fetches data from any web URL, including REST APIs.OData.Feed() is specific for OData sources, not generic REST APIs.let
Source = OData.Feed("https://services.odata.org/V4/Northwind/Northwind.svc/Products"),
Filtered = Table.SelectRows(Source, each [CategoryID] = 1)
in
FilteredOData.Feed() function returns a table of products from the OData service.Table.SelectRows() filters rows where CategoryID equals 1, which is valid for this dataset.let
Source = Web.Contents("https://api.example.com/data"),
Json = Json.Document(Source),
Table = Table.FromList(Json, Splitter.SplitByNothing())
in
TableTable.FromList() expects a list, but if JSON is an object (record), it cannot convert directly.OData.Feed() for the OData product details and Web.Contents() with Json.Document() to parse REST API stock JSON.Pass the test and this pattern moves unknown