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.
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 _ kalyj
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- BRVL3 years agoFrequent Visitor
Nevermind, I've figured it myself.
- Anonymous3 years agoNot applicable
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)
- BRVL3 years agoFrequent Visitor
Hi thanks for your reply but this does not change the result.