Forum Discussion
Issues with recuring API calls that use a dynamically generated cursor for fetching the next pages.
- 9 months ago
Hi ackerkris ,
Please refer below updated pagination logic, Please refer below snap and attached PBIX file.
I hope this information helps. Please do let us know if you have any further queries.
Regards,
Dinesh
Hi ackerkris ,
Thank you for reaching out to the Microsoft Community Forum.
The issue you are facing is classic for recursive API calls when a field can sometimes be null or not even exist, Power Query tries to access [Result][SalaryCursor] before it checks if [Result] is null, so it crashes.
Please refer below steps.
1. I have created sample data, In Power Query i have created sample M code for API function, Please refer snap.
2. Created Pagination logic, Please refer below snap.
3. For testing , I took the parameter values, Please refer in snap.
It will generate the two fields "Value" and "SalaryCursor" as below.
After expanding that two fields, you will get the below results.
Please refer attached PBIX file.
I hope this information helps. Please do let us know if you have any further queries.
Regards,
Dinesh