Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi All,
Wondering if someone can help at all, as I have been trying to do cursor based pagination using the List.Generate function and whilst I initially struggled, I have also realised why I kept getting an error doing it.
When the initial API call is made it returns 64,000 rows and a pagination token is created:
"pagination": {
"next": "bd4b9e12"
},
Give the token and it will then retrieve the next 34,000 rows of data, but the pagination token has now changed from "next" to "previous"
"pagination": {
"previous": "eaf3358b"
},
When you then try to do the 2nd condition in the List.Generate function, most how-to guides are looking for the value of null on the pagination.next value, but when it gets to the end, the data value doesn't exist as it has now changed to "previous", so the function now throws an error that the "next"field wasn't found
Expression.Error: The field 'next' of the record wasn't found.
Details:
previous=ff215675
The condition being used in the List.Generate:
each [Result][pagination][next] <> null,
Any ideas on how to do the condition on this at all?
Thanks in advance 😊
Hi @ppm1
Thanks again for trying to help troubleshoot this and can understand it is hard to work blind on this. I do hope the explainations I have given do help.
I have tried the new query you gave above and this has now resulted in:
As always, your help is greatly appreciated 😊
Thanks
How about using try ... otherwise
each try [Result][pagination][next] otherwise null <> null,
Pat
Thank you @ppm1 seems a different error is now presented:
Expression.Error: We cannot convert the value "ead5cb33" to type Logical.
Details:
Value=ead5cb33
Type=[Type]
Any ideas?
Hard to troubleshoot w/o being to connect myself, but please try this
each (try [Result][pagination][next] otherwise null) <> null,
Pat