Forum Discussion
RichardP
8 years agoHelper I
Stopping when looping through a paginated API feed
Hi everyone, I've been reading up on the advice for looping through a paginated API as a source (great resources here, here and here). I have a slightly different case which I'm trying to dea...
- 8 years ago
v-chuncz-msft
8 years agoCommunity Support
You may use the following condition to replace the try expression.
each [Page Number] = 1 or Table.RowCount([Func]) > 1,
- RichardP8 years agoHelper I
Hi v-chuncz-msft,
Many thanks for taking the time to respond :)
I modified the code to:
= List.Generate( () => [Page Number=0, Func=null], each [Page Number] = 1 or Table.RowCount([Func]) > 1, each [Page Number=_[Page Number]+1, Func=GetData([Page Number]+1)], each _[Func])
But it gives me the error message:
Expression.Error: We cannot convert the value null to type Table.
Details:
Value=
Type=TypeIf I try changing the line to say...
() => [Page Number=0, Func=1],
...then I still get the same message.
Any additional thoughts? Many thanks for your advice.
- v-chuncz-msft8 years agoCommunity Support
- RichardP8 years agoHelper I
Ah so obvious! :)
Thank you for your help.