Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hello, I have a published Power BI report that pulls data from a Web/API. Following all kinds of help videos I set it up get paginated results from the API by creating a page function and then a List.Generate code (see below). However I just found out that my published report will not schedule update because it is pulling from an API/web.
I need to figure out how to get this report to update/schedule refresh. From what I have read, this would require changing my orginal function (below) to use something called RelativePath, which I don't fully understand. I followed the instructions I read, but the updated function (also, below) when ran with the list.generate started creating new functions and got stuck trying to pull from the API. Something is wrong.
Could someone help me rewrite this to properly use relativepath so I can update my awesome published report?
List Generate (for paginated results)
= List.Generate(()=>
[Result = try fCustomers(1) otherwise null, Page=1],
each [Result]<>null,
each [Result = try fCustomers([Page]+1) otherwise null, Page=[Page]+1],
each [Result])
Original Function
= (Page as number)=>
let
Source = Json.Document(Web.Contents("https://api.vhx.tv/customers/?page="&Number.ToText(Page))),
_embedded = Source[_embedded],
customers = _embedded[customers]
in
customers
RelativePath Function
= (Page as number)=>
let
Source =
Json.Document(Web.Contents("https://api.vhx.tv/customers/",
[RelativePath="?",
Query= [
Page="?&Number.ToText(Page)"]])),
_embedded = Source[_embedded],
customers = _embedded[customers]
in
customers
Solved! Go to Solution.
I figured it out finally. You have to play around with RelativePath and there seems to be a lot of variance in how it is used.
I figured it out finally. You have to play around with RelativePath and there seems to be a lot of variance in how it is used.
Hi @rsderby68 ,
Please refer to the document to see if it helps you.
Reports - Update Report Content - REST API (Power BI Power BI REST APIs) | Microsoft Learn
I hvae also found a similar post, please refer to it to see if it helps you.
Help using RelativePath with Web.Contents to use s... - Microsoft Power BI Community
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
User | Count |
---|---|
15 | |
13 | |
12 | |
10 | |
10 |
User | Count |
---|---|
19 | |
15 | |
14 | |
11 | |
10 |