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
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"
Thanks, I`ll check it out!
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 19 | |
| 10 | |
| 9 | |
| 8 | |
| 7 |