Forum Discussion
Looking for a Limited API solution - INSIGHTLY API
You can use List.Generate to generate a nested list of lists like this:
(MaxValue as number, StartValue as number, Increment as number) =>
List.Generate( ()=>[x = StartValue, Counter = 0],
each [Counter] <= Number.RoundUp(MaxValue/Increment),
each [x = [x]+Increment, Counter = [Counter]+1],
each {[x]})Hi ImkeF Anonymous Thanks for your help and responses to this post however the solution offered does not really fit the issue - as far as I can tell, to be clear, I am ok with manually setting the start point (0) and increment will always be 500 (as this is the max rows retrieved per call from the API, what will be variable is the end point, hence I need this to be calculated based on either a value which can be retrieved from another table, or a calculation within the function. This is why I suggested a rounded max row count could be implemented - rounded up to the nearest 500 - i.e. if we perform a count of rows in another table and the result be 11,349, this would round up to 11,500. The solution provided is valid but merely replicates the one I already have, and would still require manually setting the upper limit.
Please let me know if you need any further explanation.
Thanks.
- ImkeF8 years agoCommunity Champion
Yes, I didn't fully read your description, as it contians too much irrelevant information, that costs too much time to read. (Normally I would not pic sth like this up)
The function to retrieve the desired value from a Table is this:
(Table as table, Increment as number) => Number.RoundUp(Table.RowCount(Table)/Increment)*Increment
- dan_blyth_18 years agoRegular Visitor
ImkeF Thanks I will give it a go.
I will not defend my initial post only to say that far too many threads on here are vauge resulting in solutions being suggested which are either not relevant, have been mis-interpretted or simply do not solve the issue being faced. My post may have been "detailed" (IMO), at least it gave the background and the reasons why I need(ed) such a solution.
Many thanks for your help.