Forum Discussion
Power Query - Number must be either non-negative and less than or equal to Int32.MaxValue or -1.
- 3 years ago
As you can imagine it is not possible to help much more without access to the API. Try adding more robustness to the exit check in the List.Generate part. In addition to checking for null you should also check for an empty list.
lbendlin I think I have made your amendments as suggested
(Page)=> Json.Document(Web.Contents("https://harvest.greenhouse.io/v1/jobs" as text,
[Query = [page = Number.ToText(Page)]]) )
This works ok in the PowerQuery screen, as the previous function did too. It is only once loaded that I receive the same error message again:
Thanks for your help, any other tips that might help? I did read in the API documentation:
API methods that return a collection of results are always paginated. Paginated results will include a Link (see RFC-5988) response header with the following information.
- next. The corresponding URL is the link to the next page.
- prev. The corresponding URL is the link to the previous page.
- last. The corresponding URL is the link to the last page.
Note that when this header is not set, there is only one page, the first page, of results.
But I am not sure how to adjust the query for this
Don't use Number.ToText. Use Text.From
- Anonymous3 years agoNot applicable
Thank you lbendlin that still brings in the empty rows. I have tried removing empty rows, filtered out null values etc. but the it then shows error and removing the errors brings up the Int32 issue.
I think the issue lies with the pagination looping endlessly, whilst no values or records are actually contained in the list. It was working fine a few weeks ago- lbendlin3 years ago
Super User
As you can imagine it is not possible to help much more without access to the API. Try adding more robustness to the exit check in the List.Generate part. In addition to checking for null you should also check for an empty list.