cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Syndicate_Admin
Administrator
Administrator

How to connect Powerbi source with an API Odata content?

Hello! 
I´m trying to connect with an API data in Power BI.
I´m following these specific steps:

1. New Source -> Blank Query
2. Advanced Editor
3. 

let

     Source = OData.Feed("URL", null, [Headers=[#"xxxxxx" = "TOKEN"]])
in
     Source




It worked very well and I was able to connect with this source. See the image:

phmacena_2-1631552759750.png


But when I try to select any data table, appears this error message:

phmacena_4-1631552813468.png

 

Does someone know how to solve this problem? The message says "Token not found". But i´m including the token in the previous request... 😞 



1 ACCEPTED SOLUTION

Accepted Solutions
Syndicate_Admin
Administrator
Administrator

Hi @phmacena 

 

Would it be that the token you used has expired? If you return to the first Source step and click Refresh Preview, will the Source step still get all data with the same token?

 

If the token is valid, try modifying the URL to navigate to the table directly. You can add a table name at the end of the url like "odataserviceurl/tablename".

 

Based on my test, the two queries below give me the same result of "Categories" table. 

let
    Source = OData.Feed("https://services.odata.org/V3/Northwind/Northwind.svc/", null, [Implementation="2.0"]),
    Categories_table = Source{[Name="Categories",Signature="table"]}[Data]
in
    Categories_table
let
    Source = OData.Feed("https://services.odata.org/V3/Northwind/Northwind.svc/Categories", null, [Implementation="2.0"])
in
    Source

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

View solution in original post

2 REPLIES 2
Syndicate_Admin
Administrator
Administrator

Hi @phmacena 

 

Would it be that the token you used has expired? If you return to the first Source step and click Refresh Preview, will the Source step still get all data with the same token?

 

If the token is valid, try modifying the URL to navigate to the table directly. You can add a table name at the end of the url like "odataserviceurl/tablename".

 

Based on my test, the two queries below give me the same result of "Categories" table. 

let
    Source = OData.Feed("https://services.odata.org/V3/Northwind/Northwind.svc/", null, [Implementation="2.0"]),
    Categories_table = Source{[Name="Categories",Signature="table"]}[Data]
in
    Categories_table
let
    Source = OData.Feed("https://services.odata.org/V3/Northwind/Northwind.svc/Categories", null, [Implementation="2.0"])
in
    Source

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

View solution in original post

Yes, the Token was valid when I refreshed the first step

It worked perfectly the way you suggested. Thank you very much 😄

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Users online (2,735)