How to implement paging in the Custom REST Configuration Editor.

How to implement paging in the Custom REST Configuration Editor.

There is a demonstration video that explains three different pagination templates available in the Custom REST Configuration Editor.  This demonstration video only shows a brief overview that the templates are available and how they can be used to implement common pagination types.  The demonstration video can be found on the REST documentation --> Click the Connection tab --> Click "Demonstration" on the right side menu --> choose the demonstration video named "Reading with pagination" and press the play button.

While the Custom REST Configuration Editor is able to include the code for the <Iterator>, it cannot predict the correct implementation for the Parameters that need to be included.  Therefore, the parameters have to be defined by the person creating the package in the configuration because the engine cannot automatically include them.  Those parameters can be part of the query string but they could also participate in the body. That's why they have to be defined by the person creating the package based on the requirements from the documentation from the service they are connecting to.

In the demonstration video, the 3rd example given for the "Cursor based" template, gives this further instruction that parameters also need to be created in order to make the pagination work. More specifically, instructions are given to create the parameters to associate the internal COZYROC iterator and batchSize to the required resources parameter names which are "limit" and "offset" in this case.  These parameters need to be created for the READ endpoint for the resource where pagination is to occur.

<Read Url="/events" Result="{{=response.data}}">
<Parameters>
<Parameter Name="limit" Value="{{=parameters.batchSize}}" />
<Parameter Name="offset" Value="{{=parameters.iterator}}" />
</Parameters>
<Iterator>
<Next Value="{{=parseInt(parameters.iterator || 0) + parameters.batchSize}}" />
</Iterator>
</Read>

In the demonstration video, the 2nd example for "Offset & BatchSize" does not go into detail about creating these necessary parameters, however they do also need to be created as well for this pagination type. The pagination will not work until the author of the package also creates the appropriate parameters similar as shown in the "Cursor based" example in the demonstration video.



    Book a Presales Call


    Are you new to COZYROC and evaluating our solutions? 
    Book a Presales Call with us now and get 5% off SSIS+.