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
rsderby68
Resolver I
Resolver I

Help Trying to use RelativePath to update published Power BI Report.

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

1 ACCEPTED SOLUTION
rsderby68
Resolver I
Resolver I

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.  

View solution in original post

2 REPLIES 2
rsderby68
Resolver I
Resolver I

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.  

v-rongtiep-msft
Community Support
Community Support

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.

 

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