Forum Discussion
Struggling with the cyclic reference error
- 4 years ago
Your first steps are correct
let userCount = Json.Document(Web.Contents("https://storfolloikt.pureservice.com/agent/api/user/count", [ Headers=[ Accept="application/vnd.api+json", #"X-Authorization-Key"= Text.From(#"PUSapikey") ] ]))[count], pages = Number.RoundUp(userCount / 500),but then you veer off track. Next step is to create a list with all the URLs you need to fetch the data chunks.
since you already know the number of pages you need there is not really a reason to use list.generate any more. A simple
{1..pages}
is enough. Convert that to a table, add your GetUserData function as a custom column, and combine the output.
Your first steps are correct
let
userCount = Json.Document(Web.Contents("https://storfolloikt.pureservice.com/agent/api/user/count",
[
Headers=[
Accept="application/vnd.api+json",
#"X-Authorization-Key"= Text.From(#"PUSapikey")
]
]))[count],
pages = Number.RoundUp(userCount / 500),
but then you veer off track. Next step is to create a list with all the URLs you need to fetch the data chunks.
since you already know the number of pages you need there is not really a reason to use list.generate any more. A simple
{1..pages}
is enough. Convert that to a table, add your GetUserData function as a custom column, and combine the output.
Brilliant!! Thanks so much for your help! I keep forgetting to use the powerful features provided in the UI.