Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowTry your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now
Hello guys,
I'm trying to call an API, and I'm using the page parameter to make the call. It turns out that this API seems to me to have no pages. How could I adjust the call of this function to be able to page and bring all the lines?
Function:
(
page
)
=>
let
Fonte =
Json.Document(
Web.Contents(
"https://company.company.com.br",
[
RelativePath = "/api/cvio/empreendimento/",
Query =
[
pagina = Number.ToText(page)
],
Headers =
[
accept = "application/json",
email = _email,
token = _token
]
]
)
)
in
Fonte
function call
let
totalpages = fx_empreendimento(1),
listOfPages = List.Generate(
() => [page = 1, data = fx_empreendimento(1)],
each [page] <= totalpages,
each [page = [page] + 1, data = fx_empreendimento([page]+1)]
)
in
listOfPages
The error that is returned:
Expression.Error: We were unable to apply field access to the List type.
Details:
Value=[List]
Key=total_pages
Hi @kasife ,
Whether your problem has been resolved? If yes, could you please mark the helpful post as Answered? It will help the others in the community find the solution easily if they face the same problem as yours. Thank you.
Best Regards
Hi @kasife ,
You can refer the following links to connect API in Power BI Desktop using Web connector:
How to Use List Generate to Make API calls in Power Query - YouTube
Solved: Using list.generate() to query an endpoint multipl... - Microsoft Fabric Community
And this error may occur when you are trying to access a list element by using a field name instead of an index. The following links are the ones which have the similar problem as yours, hope they can help you solve your problem.
Solved: Re: Help with List.Generate() in making API calls - Microsoft Fabric Community
Solved: Expression.Error: We cannot apply field access to ... - Microsoft Fabric Community
Best Regards
Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.
Check out the May 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 22 | |
| 22 | |
| 21 | |
| 20 | |
| 12 |
| User | Count |
|---|---|
| 58 | |
| 55 | |
| 41 | |
| 36 | |
| 35 |