Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi
I need to consult an API several times at once in order to get all the results I need But when I do that, it always pulls the same values, I believe it is because of the cache, how can I delete this cache?
Follow the base code:
(Filler as any)=>
let
Fonte = Json.Document(Web.Contents("", [Headers=[""]])),
results = Fonte[results],
#"Convertido para Tabela" = Table.FromList(results, Splitter.SplitByNothing(), null, null, ExtraValues.Error)
in
#"Convertido para Tabela"
Follow the funcion:
let
N_ = 10, //update as needed
list_ = List.Numbers(1,N_),
res_ = List.Transform(list_, function_),
final_ = Table.Combine(res_),
#"Duplicatas Removidas" = Table.Distinct(final_)
in
#"Duplicatas Removidas"
Thanks
Are you using the (Filler as any) function in your List.Transform? How is the Filler parameter being used in the function? How is the list value being used in that function? If not, you would get 10 of the same tables.
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
The parameter is not being used, the list.Transform function is invoking the function 10 times It works sometimes, I managed to list the 500 results (10 searches out of 50), but it is a bit rare, it must have been the times that the query did not get the cache of the first.
The Filler parameter is just to be able to invoke the function, but it is insignificant
Thanks
hey,
here its how you could clean manually the cache on the power bi desktop:
on the options and settings panel,
but I will recommend trying to separate the source API reading if its 10 times 10 files open 10 queries get the data and make a function to tranform them and them append them (if they all have the same headers). instead of reading all 10 items at once in the same run of the source. them disable the 10 queries from data load and left only the new appended query.
Proud to be a Super User!
Hi
He queries 10 times to give 10 different results and to add these results in a single spreadsheet, the question that when he does the 10 times he only saves the first query Only the act of clearing the cache does not solve it because the query is all at once, I needed something in Power Query that would eliminate caches or that would have 10 different queries Actually there are not 10 consultations, but 70 to 100 consultations, this is just a test
Thanks
as far as I know you cant actually loop in a same source multiple queries in it for a unique queri as the source search for 1 record 1 query to input for source you could try another approach as creating a sharepoint repository that get this 100 consultations files from a push flow from a update request of power bi (but I think you need premiun caps for this) and them connecto to that sharepoint folder and combine all the files in it.
Proud to be a Super User!
https://community.powerbi.com/t5/Desktop/Looping-through-Parameters-for-API-calling/td-p/574796 also here I found something that could be a solution for what you asking for or point you in a better direction them my answer.
Proud to be a Super User!
I tried to add the following code in the Header, but still keeps saving only the first query and the rest being all the same
#"Cache-Control"="no-cache, no-store, must-revalidate"
The other time I had this problem, this code solved it, but this time it's not working