Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Thanks to @lbendlin, I found a tip to terminate an API loop with List.Empty.
However my reference to the projNo column in the List.Generate() is erroring when I expand the table list.
#"02ListGenerate = Table.AddColumn(#"01filterProject", "dRofusRecord", each List.Generate(() =>
[proj = [projNo], skip = 0, top = 50, recordList = getURI(proj, top, skip)],
each not List.IsEmpty([recordList]),
each [proj=[projNo],
skip = [skip] + [top],
top = [top],
recordList = getURI(proj, top, skip)]
))
Thank you for any guidance.
Solved! Go to Solution.
In the List.Generate() I changed proj=[projNo] to projNo = [projNo].
This now works!
= Table.AddColumn(#"01filterProject", "dRofusRecord", each List.Generate(() =>
[projNo = [projNo], skip = 0, top = 50, recordList = getURI(projNo, top, skip)],
each not List.IsEmpty([recordList]),
each [projNo = [projNo],
skip = [skip] + [top],
top = [top],
recordList = getURI(projNo, top, skip)]
))
Thank you again @lbendlin for prompting the question. I appreciate this forum because submitting the question forces me to better understand the "problem statement."
What's the error message?
Expression.Error: The field 'projNo' of the record wasn't found.
getURI()
(projNo as text, topVal as number, skipVal as number)=>
let
#"FilterColumnTable" = Table.SelectRows(#"102APImapRooms100", each ([ObjectType] = "rooms")),
GetWebContents =
Web.Contents(
"https://api-us.drofus.com/api/company/",
[
RelativePath= projNo
& "/rooms"
& "?$select=" & Text.Combine(#"FilterColumnTable"[dRofus.ID], ",")
& "&$top=" & Number.ToText(topVal)
& "&$skip=" & Number.ToText(skipVal)
]
),
convertedJson = Json.Document(GetWebContents,65001),
in
convertedJson
In the List.Generate() I changed proj=[projNo] to projNo = [projNo].
This now works!
= Table.AddColumn(#"01filterProject", "dRofusRecord", each List.Generate(() =>
[projNo = [projNo], skip = 0, top = 50, recordList = getURI(projNo, top, skip)],
each not List.IsEmpty([recordList]),
each [projNo = [projNo],
skip = [skip] + [top],
top = [top],
recordList = getURI(projNo, top, skip)]
))
Thank you again @lbendlin for prompting the question. I appreciate this forum because submitting the question forces me to better understand the "problem statement."
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
4 | |
3 | |
3 | |
3 | |
3 |