Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
PawelSow
Frequent Visitor

Get current URL in OData feed

I am brand new for Power Query. I try to write custom connector to my OData feed. It will have to create an authorization token and insert it to the http header. To creteate a token I have to know the current executed url. I have a base url eg. https://MySite/Admin/OData which returns list of all entities e.g. Products, Promotions. ETC. It work as expected in PowerBi. It allows user to slected the entities. After that data is loadaed from urls like: https://MySite/Admin/OData/Products,  https://MySite/Admin/OData/Promotions (I have custom routing in my OData feed.) I want to know this particular url executed by PowerBi. This information is needed to create a valid token.

 

5 REPLIES 5
v-juanli-msft
Community Support
Community Support

Hi @PawelSow 

Firstly i need to confirm your requirement with you, which is your real goal from the followings:

1. you can connect to the url and this url data source is public,

   what you want is to create one kind of authentication to get the data source. 

2. you want to know how power bi do in backend when it connects to your url.

 

Best Regards

Maggie

Greg_Deckler
Super User
Super User

Hmm, well @ImkeF might be able to assist with this one. Probably will need additional information perhaps.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Hi @PawelSow 

not sure I understand the exact question here, but this article is the best source on how to make sure that dynamic queries will be refreshed in the service: http://blog.datainspirations.com/2018/02/17/dynamic-web-contents-and-power-bi-refresh-errors/ 

 

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

This unfortunatelly does not help me. In case of OData feed user provide the url to OData source. Power Bi use this url to display a form with list of all available entities types. User can choose which entities should be loaded. In my case e.g Products, Clients, Organisations. After that PowerBi try to load this data by calling relevant urls. During each of this call custom connector is executed. (I am sure about this because I inserted current time to the header.) I want to know the url which is executed or OData entity selected by user,

You can either get it from:

myData = Web.Contents(...),
myDataHeaders = Value.Metadata(myData)

Or you can use manual redirect handling. 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors