Forum Discussion
Web based cursor pagination issue
- 3 years ago
Hi BRVL ,
Have you tried to use if function like this:
each if Record.HasFields(_,"cursor")=true then Json.Document(... else...Best Regards,
Community Support Team _ kalyjIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- 3 years ago
Nevermind, I've figured it myself.
Nevermind, I've figured it myself.
Hi,
Would you mind sharing how you resolved the issue as I am struggling with a similar problem.
Thanks,
Amreet
- BRVL3 years agoFrequent Visitor
I used the below and it solved it for me:
data = let
Pagination = List.Generate( ()=> Source,
each [payments] <> null ,
each if Record.HasFields(_,"cursor") and [cursor] <>null then Json.Document(Web.Contents("https://connect.squareup.com/v2/payments?cursor=" & Text.From([cursor]), [Headers=[Authorization="Token"]] )) else Record.FromList({null, null}, {"payments","cursor"} ))
in Pagination,
#"Converted to Table1" = Table.FromList(data, Splitter.SplitByNothing(), null, null, ExtraValues.Ignore)- jrush41 year agoFrequent Visitor
Any chance you could give a little more context on how you got this working? I'm currently trying to do something similar with pagination, but can't crack it. Your above code has gotten me closer, but I'm still not there!