Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Hi guys, I hope you are well.
I created a paginated API, and when invoking it everything works perfectly. But I need to do a customer consultation, and there is a parameter that is mandatory. So when invoking the function, I used two parameters, 1st from the pagination and 2nd from the client's code, but I'm not able to make this code dynamic. I need it as it is bringing all the pages, return me all the clients as well. How can I do this?
function
let
totalpages = fx_Clientes_(1)[total_de_paginas,codigo_cliente_omie],
listOfPages = List.Generate(
() => [page = 1, data = fx_Clientes_(1)],
each [page] <= totalpages,
each [page = [page] + 1, data = fx_Clientes_([page]+1)]
)
in
listOfPages
Hi @kafreitass
You haven't been 100% clear on what it is you are trying to achieve. Please supply examples of what that is.
When you say I need it as it is bringing all the pages, return me all the clients as well. How can I do this?
What exactly do you mean? Have you got lots of pages and clients to get data for? Is that what the parameters are? if so, what values can these parameters take?
If you are trying to create a query that loops and gets data for all combinations of pages and customers, you can try storing those values in a lists. Then use List.Transform to call the function to get your data for each value in the list of customers e.g.
Customers = {"Alpha" , "Bravo" , "Charlie"},
Results = List.Transform(Customers , fx_Clientes_(Customers) )
Your code looks like it is calling the function twice, to do different things?
The first time it's getting the total number of pages for a client?
The 2nd time, (in List.Generate) it's calling the function to get data for each of those pages up to the value of totalpages?
If you are tryign to do 2 different thinsg with a single function, you should create 2 functions. 1 each to do the 2 things you want.
Regards
Phil
Proud to be a Super User!
Hi @kafreitass
Perhaps creating a parameter in PQ would be the answer to your problem
Regards
Phil
Proud to be a Super User!
@PhilipTreacythanks for answering
But from what I'm understanding this way I need to impute all the values in the parameter. And the values that will be created by the system?
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the June 2024 Power BI update to learn about new features.
User | Count |
---|---|
90 | |
89 | |
79 | |
70 | |
69 |
User | Count |
---|---|
226 | |
129 | |
119 | |
84 | |
77 |