Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Error while parsing API response in Power Query

Hi all,   I am trying to parse the API response in Power Query and use the response as a table in Power BI.  The data is paginated, and that's why I am using the List.Generate function along with ...
  • ahadkarimi's avatar
    2 years ago

    Hey Anonymous, 
    Try this code and let me know if there are any problems.

    let
    Source = List.Generate(
    () => [Result = Query1("url")],
    each [Result] <> null and Record.HasFields([Result], "next_page_url") and [Result][next_page_url] <> null,
    each [Result = Query1([Result][next_page_url])],
    each [Result][results]
    )
    in
    Source