Forum Discussion

JJS8080's avatar
JJS8080
Frequent Visitor
8 months ago
Solved

Changing from a dynamic to a fixed data source

I have written the below code to pull data from a api, I want to be able to refresh it automatically daily however due to it being a dynamic data source I cannot how can I change the code to get arou...
  • v-echaithra's avatar
    v-echaithra
    8 months ago

    Hi JJS8080 ,

    If you're still seeing a dynamic data source even after trying the previous suggestions, that means Power BI is detecting a fully constructed URL somewhere in the query. Power BI will always block scheduled refresh when any Web.Contents call uses a dynamically-built URL string.
    Try to rewrite your paging function so that every Web.Contents call uses this structure:

    Web.Contents(
    "https://api.aircall.io",
    [
    RelativePath = "v1/calls",
    Query = [
    per_page = "50",
    page = PageNumber,
    from = FromUnix,
    to = ToUnix
    ],
    Headers = [ Authorization = encodedAuth ]
    ])


    No concatenated strings.
    No full URLs.
    No manually built "https://api.aircall.io/v1/calls?...“.
    Once the paging logic is rewritten using RelativePath + Query only, your dataset will become refreshable in the Power BI Service.


    Hope this helps.
    Thank you.