Copy Activity: How to iterate through Busincess Central API using Pagination ?

Osama Ahmed 131 Reputation points
2022-05-31T03:09:33.24+00:00

Hello Everyone,

I am new to using Azure Data Factory and I am currently working on a project to copy data from Dynamics 365 Business Central API to Azure SQL Database. I have set up all the steps and everything worked fine, but only the first entry is copied into the SQL database and the rest of the data is not copied. I tried using the "EndCondition" pagination rule put the pipeline keeps running for a long time, and I think I made a mistake and I set an infinite loop. If any one has encountered such issue, your help and guidance will be much appreciated.

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

Accepted answer
  1. MartinJaffer-MSFT 26,236 Reputation points
    2022-06-01T16:54:56.387+00:00

    Oh I see, so this isn't about problems with paging, this is about getting all the data in a single page.

    Several things to check. First of all, in your mapping, is there an array index like $.value[0].name ? Like I show in the image below:

    207651-image.png

    This would cause only the first record's properties to be recorded. The [0] means get the item 0 places from the top.

    Instead you would need to use the Collection reference. In your case that would be set to $.['value'] . The column mapping would also need to be changed, and not start with $. Again, image below. I hope I remember the format right. I think it was just the property name, or ['property name'].

    207661-image.png

    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.