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
alxrz
Regular Visitor

Web.Contents is not working with Scheduled Refresh [BUG]

I'm trying to use function Web.Contents which is supported (as "Web") according to https://support.powerbi.com/knowledgebase/articles/474669-refresh-data

 

Here's my part of code:

...
url = Text.Combine(prepared_url, ""), // goes to https://www.googleapis.com/analytics/v3/data/ga
contents = Web.Contents(url),
jsR = Json.Document(contents),

...

 

I've tested line by line and starting from 2nd line, once it's included in a query, then scheduled refresh is not available any more!.

 

BUT in my another query (in the same dataset) I used Web.Contents with the same structure (naming is different) and scheduled refresh was available!. So I believe I'm allowed to use only one Web.Contents in one dataset OR except making calls to "googleapis"?

 

P.S. as suggested in one of the threads I've tried to use dataset in shared onedrive (opposed to publish now button in desktop version).

 

Please help, how to make it work?

1 ACCEPTED SOLUTION
curth
Power BI Team
Power BI Team

The reason this isn't working is because you're generating the URL programmatically. For the most part, the URL will need to be a literal for refresh to work. If you need to construct an URL from a literal base path and a variable relative path, you could try specifying the base path as the first argument to Web.Contents and then using the RelativePath query option for the variable part. This has the limitation, though, that the base path by itself must be accessible or the "Test Connection" process will fail.

View solution in original post

3 REPLIES 3
curth
Power BI Team
Power BI Team

The reason this isn't working is because you're generating the URL programmatically. For the most part, the URL will need to be a literal for refresh to work. If you need to construct an URL from a literal base path and a variable relative path, you could try specifying the base path as the first argument to Web.Contents and then using the RelativePath query option for the variable part. This has the limitation, though, that the base path by itself must be accessible or the "Test Connection" process will fail.

I think I have a similar problem, when specifying headers in the web.contents call. Do you guys mind having a quick look? 

http://community.powerbi.com/t5/Service/web-contents-with-specified-headers-works-in-PBI-desktop-but...

Do you have any examples of a working parameterized web query where scheduled refresh is allowed?  I am not finding any information on the "RelativePath" query option for the variable part.  

If we are only allowed to specify static urls for scheduled refresh, it severely limits the functionality of the dashboards one can build. 


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
Top Kudoed Authors