Forum Discussion

sceccolini's avatar
sceccolini
Frequent Visitor
1 year ago
Solved

Online refresh not supported - Web.Contents, RelativePath and Query

Hello Community,   I need your support to troubleshoot my issue with the online refresh not enabled. I defined the following function 'ExecuteREST' to invoke a REST with pagination by using Web.Con...
  • sceccolini's avatar
    1 year ago

    Hi all,

     

    I resolved this by having a unique function rather than a dedicated REST client:

    let
        BaseUrl = "MY BASE URL",
        GetPage = (PageNumber as number) =>
            let
                Response = Json.Document(Web.Contents(
                    BaseUrl,
                    [
                        RelativePath = "MY RELATIVE PATH",
                        Query = [
                            param = "MY PARAM",
                            page = Text.From(PageNumber)
                        ],
                        Timeout = #duration(0, 0, 10, 0) // Imposta il timeout a 10 minuti
                    ]
                )),
                Results = try Response[entries] otherwise null
            in
                Results,
        GetAllPages = List.Generate(
            () => [PageNumber = 1, Results = GetPage(1)],
            each [Results] <> null and List.Count([Results]) > 0,
            each [PageNumber = [PageNumber] + 1, Results = GetPage([PageNumber] + 1)],
            each [Results]
        ),
        CombinedResults = List.Combine(List.Transform(GetAllPages, each _)),
        ResultTable = Table.FromList(CombinedResults, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
        #"Expanded Column1" = Table.ExpandRecordColumn(ResultTable, "Column1", {"content"}, {"content"}),
        #"Expanded content" = Table.ExpandRecordColumn(#"Expanded Column1", "content", {"properties"}, {"properties"}),
    ....