Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
pafernandes
Regular Visitor

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. 

 

pafernandes_0-1637346207121.png

4 REPLIES 4
Anonymous
Not 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

mahoneypat
Microsoft Employee
Microsoft 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
Custom1

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


mahoneypat
Microsoft Employee
Microsoft 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

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Hi Pat.
Yes, the return is FALSE and the _query its string.

I did a query example and work perfectly. 

pafernandes_0-1637587709054.png

 

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors