Hello @Meghana Nikam and welcome to Microsoft Q&A.
If I understand correctly, those 5 properties need to be passed in request body, not headers. Also, of those 5, only start_row and end_row change. You said you know how many rows total there are (the counts)?
You were also able to make it copy data with the REST dataset, but only fixed, not dynamic.
I think the solution is to put the Copy activity inside a loop. The loop will make the body and pass to Copy activity. The Copy activity uses the REST dataset from your first example.
First we need to know how many pages.
Let us define some variables:
- api_row_count : the count of records you got from API
- count_per_page : how many records you want in each request
- total_pages : how many pages total
- page_array : an array type variable we will store page numbers in
total_pages = ceiling( api_row_count / count_per_page )
@string(
if(
greater(
div(float(variables('api_row_count')),float(variables('count_per_page'))),
div(int(variables('api_row_count')),int(variables('count_per_page')))),
add(1,div(int(variables('api_row_count')),int(variables('count_per_page')))),
div(int(variables('api_row_count')),int(variables('count_per_page'))))
)
page_array = range(0,total_pages) => [0,1,2,3,4...]
@range(0,int(variables('total_pages')))
Then we pass page_array to be items in a forEach loop. Inside the forEach loop, we have the copy activity using the REST dataset. In the body we can have
start_row = (current_page * count_per_page) + 1
end_row = ( 1 + current_page) * count_per_page
{
"start_row" : @{add(1,mul(item(),int(variables('count_per_page'))}
, "end_row" : @{ mul( item(), add(1, int(variables('count_per_page'))))}
, "email_id" : "xxxx"
, "security_pin" : "xxxx"
, "cin_login_code": "xxxx"
}
item() is the current value the loop is on. It is taken from the iteration over page_array.
Does this help?