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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Web Datasource refresh issue (web.contents)

Hi,

 

Iam getting the following error "You can't schedule refresh for this dataset because the following data sources currently don't support refresh:

  • Data source for Query1

 When i publish the report to power bi service, im facing this issue and in power bi desktop it works well.I have referred to following blog Chris Webb blog: https://blog.crossjoin.co.uk/2016/08/.

 

But Nothing helped me. Iam unable to fix this. I need to use the relative path and Query parameters for the following code

 


Source = Json.Document(Web.Contents("https://nam.api.newvoicemedia.com/stats/agent-activities/interactions?end="&Date.ToText(EndDate, "yyyy-MM-dd")& "T23:00:00.000Z"&"&start="&Date.ToText(StartDate, "yyyy-MM-dd")& "T00:00:00.000Z"&"", [Headers=[Accept="application/vnd.newvoicemedia.v3+json", Authorization="bearer "&GetAccessToken()]])),

 

Any help is appreciated.

 

thanks

 

 

1 ACCEPTED SOLUTION
v-jingzhang
Community Support
Community Support

Hi @Anonymous 

I can't test this but maybe you can try below codes:

Source = Json.Document(Web.Contents("https://nam.api.newvoicemedia.com/stats/agent-activities/interactions",
[
Query=[end=Date.ToText(EndDate, "yyyy-MM-dd")& "T23:00:00.000Z", start=Date.ToText(StartDate, "yyyy-MM-dd")& "T00:00:00.000Z"],
Headers=[Accept="application/vnd.newvoicemedia.v3+json", Authorization="bearer "&GetAccessToken()]
]
)),

Or 

Source = Json.Document(Web.Contents("https://nam.api.newvoicemedia.com/stats/agent-activities/interactions?end=2021-01-01T23:00:00.000Z&start=2020-12-01T00:00:00.000Z",
[
Query=[end=Date.ToText(EndDate, "yyyy-MM-dd")& "T23:00:00.000Z", start=Date.ToText(StartDate, "yyyy-MM-dd")& "T00:00:00.000Z"],
Headers=[Accept="application/vnd.newvoicemedia.v3+json", Authorization="bearer "&GetAccessToken()]
]
)),

Reference:

API Pagination + Throttling + Dynamic data source ... - Microsoft Power BI Community

Dynamic Web.Contents() and Power BI Refresh Errors – Data Inspirations

 

Regards,
Community Support Team _ Jing

View solution in original post

7 REPLIES 7
akashgera
Helper I
Helper I

Hi @v-jingzhang 

I need your help in executing the below query which will generate the access token using power query.

akashgera_0-1628174167163.png

 

After executing the above query it throws as error: webcontents failed to get contents from the given URL

Doing the same in Postman and giving the proper response, check the screenshot below

akashgera_1-1628174167440.png

 

Pls help!!

v-jingzhang
Community Support
Community Support

Hi @Anonymous 

I can't test this but maybe you can try below codes:

Source = Json.Document(Web.Contents("https://nam.api.newvoicemedia.com/stats/agent-activities/interactions",
[
Query=[end=Date.ToText(EndDate, "yyyy-MM-dd")& "T23:00:00.000Z", start=Date.ToText(StartDate, "yyyy-MM-dd")& "T00:00:00.000Z"],
Headers=[Accept="application/vnd.newvoicemedia.v3+json", Authorization="bearer "&GetAccessToken()]
]
)),

Or 

Source = Json.Document(Web.Contents("https://nam.api.newvoicemedia.com/stats/agent-activities/interactions?end=2021-01-01T23:00:00.000Z&start=2020-12-01T00:00:00.000Z",
[
Query=[end=Date.ToText(EndDate, "yyyy-MM-dd")& "T23:00:00.000Z", start=Date.ToText(StartDate, "yyyy-MM-dd")& "T00:00:00.000Z"],
Headers=[Accept="application/vnd.newvoicemedia.v3+json", Authorization="bearer "&GetAccessToken()]
]
)),

Reference:

API Pagination + Throttling + Dynamic data source ... - Microsoft Power BI Community

Dynamic Web.Contents() and Power BI Refresh Errors – Data Inspirations

 

Regards,
Community Support Team _ Jing

Anonymous
Not applicable

Hi,

 

there was small mistake in my code and it works now, the data source refresh error gone now. 

 

Thank you so much 🙂

 

But one thing is datasource credentials are greyed out in power bi service 

and under parameters section -> if i change the start and end date value and click apply. nothing happens..

 

Do you have any idea about this

 

Your help is much appreciated.

 

Anonymous
Not applicable

Hi,

 

Datasource refresh error gone now in PBI service. But Datasource credentials and schedule refresh are faded out.

 

Do I need to install gateway to use the Web API datasource.

 

If yes, Do we have to use on premise gateway or Personal ?

kindly let me know what should be done to fix this.

 

any help is appreciated

 

Sorry for the late reply. If only this Web API data source is included in the report, it is not necessary to install an on-premises gateway.

I see you have solved this problem, can you share the final solution you found? This may help other users who have similar problems in the future. Thanks.

Anonymous
Not applicable

Hi

 

The issue not resolved until i install the personal gateway. Once installed, i skip test connection for all apis and im able to do schedule refresh the dataset.

 

Thanks

Anonymous
Not applicable

Hi,

 

I have tried your code, it works when i pass the parameters in function before "let" in the code. 

And when i include the below code, the entire table changed to function. Iam using this table with other tables for joins. So others are not working.

 

(StartDate as date,EndDate as date) =>
let
Source = Json.Document(Web.Contents("https://nam.api.newvoicemedia.com/stats/interactions",
[
Query=[end=Date.ToText(EndDate, "yyyy-MM-dd")& "T23:00:00.000Z", start=Date.ToText(StartDate, "yyyy-MM-dd")& "T00:00:00.000Z"],
Headers=[Accept="application/vnd.newvoicemedia.v3+json", Authorization="bearer "&GetAccessToken()]
]
)),

 

I have two parameters created, startDate and endDate and i directly passed the parameters inside the url like this before :

 

Source = Json.Document(Web.Contents("https://nam.api.newvoicemedia.com/stats/agent-activities/interactions?end="&Date.ToText(EndDate, "yyyy-MM-dd")& "T23:00:00.000Z"&"&start="&Date.ToText(StartDate, "yyyy-MM-dd")& "T00:00:00.000Z"&"", [Headers=[Accept="application/vnd.newvoicemedia.v3+json", Authorization="bearer "&GetAccessToken()]])),

 

So there is no impact , the table remains the same and joins works with other tables.

 

But the thing is the I need to use the query parameter and relative path to publish in service without any error.

 

Please find the screenshots belowError.png

 

Kindly help me. 

 

Regards

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors