Pagination issue in Azure Data Factory

Kunal Kumar Sinha 171 Reputation points
2020-10-29T05:28:24.177+00:00

I'm trying to fetch data from API where the result is split over multiple pages, The response from API is something as below.

{ "story_count": 212, "next": "?page=2", "previous": null, "results": [{

I tried using the rule as QueryParameters['next'] and value as $['next'] but the copy gets in infinite loop and fetches data only from first page.
I'm stuck how to fetch data for second and many more pages to come till I get next value as NULL, please help many thanks !

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
10,826 questions
{count} votes

Accepted answer
  1. HarithaMaddi-MSFT 10,136 Reputation points
    2020-11-02T13:51:30.15+00:00

    Thanks @Kunal Kumar Sinha for waiting. I got an update from our team that it is not possible to implement this using the current response from API and one approach is API response to be modified as below, then pagination rules can be used in below format

    {  
      "story_count": 212,  
      "next": "2",  
      "previous": null,  
      "results": []  
    }  
    

    And the pagination rules should be:

    QueryParameters['page']: $['next']  
    

    Another approach is to implement the manual pagination in which data can be fetched till the value for next becomes null.

    Please let us know if this helps in resolving the issue.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.