API pagination & Data Factory

Mark E 161 Reputation points
2020-08-07T18:14:12.52+00:00

Hi,
I’m working on pulling a data source in via ADF and have the connection all setup and working.
The problem I’ve got is that the API will only return a max of 50 records but does present the following in the JSON.

"paging": {
"offset": 0,
"limit": 50,
"total": 85
}

So I know there are more records there but cannot for the life of me work t the best way to have ADF cycle through and have failed to find a representative example as yet. Any help appreciated in pointing me in the right direction here.

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

3 answers

Sort by: Most helpful
  1. MartinJaffer-MSFT 26,236 Reputation points
    2020-08-10T20:20:32.54+00:00

    Hello @Mark E and thank you for your question.

    The pagination support in the REST connector is rather limited. It does not support that form of pagination out-of-the-box. You can help prioritize this feature improvement by voting for it at the feedback forum. There are several requests to choose from:

    I can provide you a convoluted work around if you are interested. The work-around involves first using a web activity to get the paging, offset, limit, and total you mentioned, then set up variables for a loop. Inside the loop there is copy activity and set variable activities. The drawback is each copy activity produces a separate files.
    To get around the self-referencing variable limitation, I use 2 variables, X and Y. First I set Y = X + 1. Then I set X = Y. That is how I increment variables.

    Let me know if you are interested, and I will provide pictures.

    Thank you for your patience,
    Martin.

    2 people found this answer helpful.

  2. Corey Edwards 1 Reputation point
    2020-11-24T22:22:36.343+00:00

    Did the convoluted workaround get posted? Also have this problem...

    0 comments No comments

  3. MartinJaffer-MSFT 26,236 Reputation points
    2022-02-23T21:58:44.487+00:00

    New features for handling pagination have been added since this question was originally asked.
    See https://learn.microsoft.com/en-us/azure/data-factory/connector-rest?tabs=data-factory#pagination-support

    0 comments No comments

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.