Forum Discussion

dor-rog-tech's avatar
dor-rog-tech
Helper I
3 years ago
Solved

Help with dynamic data source refresh and RelativePath+Web.Contents

Hello!

I have dataset which came from my app online in this platform:
tadabase 

They have documentation regarding the connection between their database and powerbi.
The connection works very well on the desktop, but when I want to refresh on the service, it gives me the error message of:

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.

 

From a search here around the forum, I found that the formula of RelativePath with Web.Contents needs to be inserted in some way.

Can anyone help me figure out exactly where?

 

 

let 
    apiUrl = "https://api.tadabase.io/api/v1/data-tables/<REPLACE-WITH-YOUR-TABLE-ID>/records",
    perPage = 100,
    GetJson = (Url) =>
        let Options = [Headers =[
    			          #"X-Tadabase-App-Key"= "<REPALCE WITH YOUR APP KEY>", 
                          #"X-Tadabase-App-Secret"= "<REPLACE WITH YOUR APP SECRET >",
                          #"X-Tadabase-App-id"="<REPLACE WITH YOUR APP ID>"
			          ]
		          ],
            RawData = Web.Contents(Url, Options),
            Json    = Json.Document(RawData)
        in  Json,

     GetPage = (Index) =>
        let Page  = "page=" & Text.From(Index),
            Limit   = "limit=" & Text.From(perPage),
            Url   = apiUrl & "?" & Page & "&" & Limit,
            Json  = GetJson(Url),
            Value = Json
        in  Value,

     getRecords = (page as number, AccumData as list) =>
            let
                Data = Function.InvokeAfter(()=>GetPage(page), #duration(0,0,0,2)),         
                Result =      
                    if page >= Data[total_pages] 
                    then Table.FromRecords(List.Combine({AccumData, Data[items]}))
                    else @getRecords(page + 1, List.Combine({AccumData, Data[items]})) 
            in
                Result,
 
    Records  = getRecords(1, {})
in
    Records

 

 


Thank you!

  • GilbertQ's avatar
    GilbertQ
    3 years ago

    Hi dor-rog-tech 


    Set the options for the data source to skip the connection test and try that again?

7 Replies