Forum Discussion
Consuming paginated reports
Hi everyone.
I'm trying consuming a SalesForce query using the function List.Generate, but something isn't working very well.
Each request result 3 rows.
[done] = When is false this means that we have more pages.
[nextRecordsUrl] = the URL to next record.
[records] = Lists.
I'm using the function above but only receive an empty list.
let
#"Request Paginated" = List.Generate(()=>
[Result = try fn_buscarSalesforce(_query1) otherwise null],
each [Result][done] = "FALSE",
each [Result = try fn_buscarSalesforceNextPage([Result][nextRecordsUrl]) otherwise null],
each [Result])
in
#"Request Paginated"
Both subfunctions fn_buscarSales... work very well, when I run isolated.
4 Replies
- mahoneypatMicrosoft Employee
Two things to consider
Is FALSE really in all caps (M is case sensitive)?
Is the output of _query1 a text string URL? If not, it will return null, your condition will not be met, and it will never return a result.
Pat
- pafernandesRegular Visitor
Hi Pat.
Yes, the return is FALSE and the _query its string.
I did a query example and work perfectly.
- mahoneypatMicrosoft Employee
Your syntax looks correct. I wrote the expression below to test it out. Try it out in a blank query to confirm. In my case, the expected result contains one list (in the list).
let
query1 = [done = "FALSE", records = {1,2,3}],
query2 = [done = "TRUE", records = {1,2,3}],
Custom1 = List.Generate(()=> [Result = try query1 otherwise null], each [Result][done] = "FALSE", each [Result = try query2 otherwise null], each [Result][records])
in
Custom1Pat
- AnonymousNot applicable
Hi pafernandes ,
Does mahoneypat 's method help you ? If it is, kindly Accept it as the solution to make the thread closed. More people will benefit from it.
If not, please share more detail information to help us clarify your scenario.
Best Regards,
Eyelyn Qin