Forum Discussion
DSArkphire
7 years agoFrequent Visitor
Web-based Cursor-Based Pagination issues
Hi I’ve been working on trying to use List.generate to create a paginated list from a api. My issue is that my api uses Cursor-Based Pagination. A single request will give me three sections “has-more...
- 7 years ago
Hi DSArkphire
you're not using the correct syntax to reference objects in Power Query / the M-language.
Try this:
Pagination = List.Generate( ()=> Source, // Start value should be a record each [offset] <> 0 // refers to the records field (your expression would always return true) each Json.Document(Web.Contents(<YourURLin””> & Text.From([offset]) )
Further reading on value types and how to reference them: https://docs.microsoft.com/en-us/powerquery-m/expressions-values-and-let-expression
ImkeF
7 years agoCommunity Champion
Hi DSArkphire
you're not using the correct syntax to reference objects in Power Query / the M-language.
Try this:
Pagination = List.Generate( ()=> Source, // Start value should be a record each [offset] <> 0 // refers to the records field (your expression would always return true) each Json.Document(Web.Contents(<YourURLin””> & Text.From([offset]) )
Further reading on value types and how to reference them: https://docs.microsoft.com/en-us/powerquery-m/expressions-values-and-let-expression
- DSArkphire7 years agoFrequent Visitor
Thank you for your Help ImkeF and for explaining my problem, that's a big help.