Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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 |
---|---|
25 | |
12 | |
8 | |
6 | |
6 |
User | Count |
---|---|
26 | |
12 | |
11 | |
8 | |
7 |