title: Azure Data Factory REST how to manage pagination as a GET url parameter retrieving a pagination id from previous call result
body: <p>I have an existing data source in Azure Data Factory calling a REST API</p>
  
  <p>My last working config (built with the UI) without pagination uses dataset parameters to build a relative URL, it translates in the source as :</p>
  
  <pre><code>"typeProperties": {
    "relativeUrl": {
      "value": "@concat('theRoute?cursor=',dataset().cursor,'&amp;nb=100&amp;q=aDateParameter:[',dataset().startDate, ' TO ', dataset().endDate, ']')",
      "type": "Expression"
    },
    "requestMethod": "GET",
  }
  </code></pre>
  
  <p>(With the dataset parameter "cursor" default value being "*" to initialize a pagination)</p>
  
  <p>Then in each response I will have to retrieve #.header.nextCursor to get the nextCursor id (# being the json root of the response), and before anybody asks, yes, there is indeed a nested doc named "header" in the json body, nextCursor is not in the http headers. </p>
  
  <p>So I will have to replace in my relative URL the value of the "cursor" parameter with the id in #.header.cursor. But I fails to create the pagination rules. (Even if the doc explicitly list a "Next request’s query parameter = property value in current response body" scenario).</p>
  
  <ul>
  <li><p>Creating a new relative url in the pagination rules fails because I apparently can't use the #.header.json syntax in the Expression builder.</p></li>
  <li><p>The QueryParameters syntax I found in <a href="https://docs.microsoft.com/en-us/azure/data-factory/connector-rest#pagination-support" rel="nofollow noreferrer">The doc</a> fails. I don't understand the doc. I tried 3 different ways 1) <code>"QueryParameters.cursor": "#.header.nextCursor</code> 2) <code>QueryParameters['cursor']: "#.header.nextCursor</code> and 3) (which makes more sense to me) <code>"QueryParameters": {"cursor": "#.header.nextCursor"}</code> But none worked.</p></li>
  </ul>
  
  <p>Also I'm wondering if it would simply inject this to replace the actual cursor parameter in my previous relativeURL... Or if I would somehow have to find another way than my concat expression to pass my url parameters for the original relative url (I can't find any documentation on a way to eventually use this QueryParameter syntax outside pagination rules, nor any doc or example for a POST data body dynamic construction syntax)</p>