Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 40 | |
| 35 | |
| 34 | |
| 31 | |
| 28 |
| User | Count |
|---|---|
| 137 | |
| 102 | |
| 71 | |
| 67 | |
| 65 |