0

I've been following some tutorial to handle pagination when calling an API limited to 100 records per request.

I'm using the latest version of PowerBI Desktop.

I have created a blank query and opened the Advanced Editor

let
    allDeployments = List.Generate(
        () => [result=GetDeployments(0), continuation=0],
        each [continuation] <> null,
        each [result=GetDeployments(GetNextContinuationToken(continuation)), continuation=GetNextContinuationToken(continuation)],
        each [result])
in
    allDeployments

and I get this error : Expression.Error: The name 'continuation' wasn't recognized. Make sure it's spelled correctly.

I can't figure out what is the problem. Do you have an idea ?

jeromesubs
  • 63
  • 1
  • 7

1 Answers1

0

After a good night of sleep, I finally found the issue in my syntax. I forgot some square brackets around "continuation" variable.

Here is the correct code:

let
    allDeployments = List.Generate(
        () => [result=GetDeployments(0), continuation=0],
        each [continuation] <> null,
        each [result=GetDeployments(GetNextContinuationToken([continuation])), continuation=GetNextContinuationToken([continuation])],
        each [result])
in
    allDeployments
jeromesubs
  • 63
  • 1
  • 7