Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I`m currently experiencing issues with the request limit of an api. Below is my code. I've been trying to use
Function.InvokeAfter(Pagination, #duration(0,0,0,2)
But I can't get it to work. Any suggestions on how to implement this in here:
Thanks 🙂
let Pagination = List.Skip(List.Generate( () => [WebCall=[], Page = 1, Counter=0], // Start Value each List.Count(Record.FieldNames([WebCall]))>0 or [Counter]=0, // Condition under which the next execution will happen each [ WebCall = Json.Document(Web.Contents("https://api.rechargeapps.com/customers/?page="&Text.From([Page])&"", [Headers=[#"x-recharge-access-token"="APIKEY"]])), // retrieve results per call Page = [Page]+1, Counter = [Counter]+1// internal counter ] ) ,1), #"Converted to Table" = Table.FromList(Pagination, Splitter.SplitByNothing(), null, null, ExtraValues.Error), #"Expanded Column1" = Table.ExpandRecordColumn(#"Converted to Table", "Column1", {"WebCall"}, {"Column1.WebCall"}), #"Expanded Column1.WebCall" = Table.ExpandRecordColumn(#"Expanded Column1", "Column1.WebCall", {"customers"}, {"Column1.WebCall.customers"}), #"Expanded Column1.WebCall.customers" = Table.ExpandListColumn(#"Expanded Column1.WebCall", "Column1.WebCall.customers"), #"Expanded Column1.WebCall.customers1" = Table.ExpandRecordColumn(#"Expanded Column1.WebCall.customers", "Column1.WebCall.customers", {"id", "shopify_customer_id", "created_at", "updated_at", "status"}, {"Column1.WebCall.customers.id", "Column1.WebCall.customers.shopify_customer_id", "Column1.WebCall.customers.created_at", "Column1.WebCall.customers.updated_at", "Column1.WebCall.customers.status"}) in #"Expanded Column1.WebCall.customers1"
@Auke,
Do you add Function.InvokeAfter(Pagination, #duration(0,0,0,2) into #"Converted to Table" line in your code?
I would recommend you use Ken's code or Chris's code in this similar thread and check if it works as expected.
Regards,
Lydia
Thanks, I`ll check it out!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.