The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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.
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
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
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
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
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Hi Pat.
Yes, the return is FALSE and the _query its string.
I did a query example and work perfectly.