Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago

How to Add Relative path to existing Power Query to enable schedule refresh for Web data sources ?

Hi Community, 

 

I am working on Web data source ( REST API call ) for the first time . I am able to refresh and fetch data using Web.contents() in Power query /Power BI desktop . However, We would like to publish report in Power BI service and enable schedule refresh . I am not able to schedule refresh and it says the below .

 

This dataset includes a dynamic data source. Since dynamic data sources aren't refreshed in the Power BI service, this dataset won't be refreshed. Learn more: https://aka.ms/dynamic-data-sources.

  • Data source for Query1

 

Some where in Community, i read that we need to add relative path to get the schedule refresh enabled for dynamic data sources.  I tried ,but i am not able to succed . I have added below the Power Query i am using in report . Please assist me to sort out this issue . 

 

let
url =
"https://xyz.com/api/v1.1/data/search?format=object&query=search%20Host%20with%20(traverse%20%3A%3A%3ASoftwareInstance%20as%20mw_sis%20where%20not%20excluded%20and%20%23Element%3AMaintainer%3APattern%3APattern.%23Pattern%3APatternModuleContainment%3APatternModule%3APatternModule.tree_path%20matches%20%27Application%20Server%20Middleware%27%20traverse%20ElementWithDetail%3ASupportDetail%3ASoftwareDetail%3ASupportDetail%20as%20support_detail)%20where%20nodecount(traverse%20%3A%3A%3AGroup%20where%20critical)%20%3E%200%20order%20by%20name%20show%20name%2C%20explode%20%23mw_sis.type%20%2C%20%23mw_sis.version%2C%20%23mw_sis.%23%3ASupportDetail%3ASoftwareDetail%3ASupportDetail.lowes_eos%2C%20explode%20replace(%23ContainedItem%3AContainment%3AContainer%3AGroup.name%2C%20%27StaticApp%3A%20%27%2C%20%27%27)%20as%20%27App%20Name%27%2C%20explode%20%23ContainedItem%3AContainment%3AContainer%3AGroup.app_id%20as%20%27App%20Id%27%0Aprocesswith%20show%20%405%20as%20%27App%20Id%27%2C%20%404%20as%20%27App%20Name%27%2C%20name%20as%20%27Server%20Name%27%2C%20%401%20AS%20%27Server%20Middleware%20Software%20Instance%27%2C%20%402%20AS%20%27Software%20Version%27%2C%20%403%20as%20%27End%20of%20Support%20Date%27",
FnGetOnePage =
(url) as record =>
let
Source = Json.Document(Web.Contents(url,[Headers=[Authorization="Bearer xyz"]])),
data = try Source{0}[results] otherwise null,
next = try Source{0}[next] otherwise null,
res = [Data=data, Next=next]
in
res,
CombinedList=
List.Combine(
List.Generate(
()=>[res = FnGetOnePage(url)],
each [res][Data]<>null,
each [next_url= [res][Next], res = FnGetOnePage(next_url)],
each [res][Data])),
#"Converted to Table" = Table.FromList(CombinedList, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Expanded Column1" = Table.ExpandRecordColumn(#"Converted to Table", "Column1", {"App Id", "App Name", "End of Support Date", "Server Middleware Software Instance", "Server Name", "Software Version"}, {"App Id", "App Name", "End of Support Date", "Server Middleware Software Instance", "Server Name", "Software Version"}),
#"Reordered Columns" = Table.ReorderColumns(#"Expanded Column1",{"App Id", "App Name", "Server Name", "Server Middleware Software Instance", "Software Version", "End of Support Date"})
in
#"Reordered Columns"

 

Thanks

G Venkatesh 

 

3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Any Help Please ?

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Community,

       

      Based on the suggestion provided, I Included RelativePath and Query in my m query . It still didnt worked . Its strange that there is no function called RelativePath . Also, I have gone through the blog written by Chris Webb related to RelativePath and Query option .It didnt helped . 

       

       

      Please assist. 

       

      G Venkatesh