<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Pagination with Authentication and XML response in Connectivity &amp; Data Prep</title>
    <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Pagination-with-Authentication-and-XML-response/m-p/1674743#M7995</link>
    <description>&lt;P&gt;Dear community,&lt;/P&gt;&lt;P&gt;I am struggling with the Rest Connector at the moment.&lt;/P&gt;&lt;P&gt;I want to connect to a SharePoint list that has more than 100 entries. Therefore, the response is split into multiple pages.&lt;/P&gt;&lt;P&gt;The connection itself is working, so if I specify "No Pagination" I get 100 entries as a result.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Because I was not sure how to set the Pagination of SharePoint in QV Connector, I read the maximum ID from the result set and use this in a loop to connect to the next set:&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;1. First request: "url=https://{our page}/_api/Web/Lists(guid'{...}')/items?%24skiptoken=Paged%3dTRUE%26p_ID%3d0"&lt;/P&gt;&lt;P&gt;2. Next request (max ID = 112):&amp;nbsp;"url=https://{our page}/_api/Web/Lists(guid'{...}')/items?%24skiptoken=Paged%3dTRUE%26p_ID%3d112"&lt;/P&gt;&lt;P&gt;And if I check this manually in Chrome, I can see that the next result entry I get is ID = 113.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But if I put this in a loop in QV, the first connection is set and the results are loaded in a table. Then the maximum ID is read into a variable, which is still working (var = 112).&lt;/P&gt;&lt;P&gt;But after the next connection, which uses the url from 2. above (I checked this in Debug mode - the url is correct), I still get the same result set as in the first query and my maximum ID again is 112... I tried this also with PaginationMode=Custom (see below), but to no avail.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, can someone tell me if I miss some logic here? Here is the full code (shortened and censored):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SET vNextPage = https://{page}/_api/Web/Lists(guid'{...}')/items?%24skiptoken=Paged%3dTRUE%26p_ID%3d;&lt;BR /&gt;LET vLastId = 0;&lt;BR /&gt;SET ErrorMode = 0;&lt;BR /&gt;&lt;BR /&gt;myList:&lt;BR /&gt;LOAD 0 as %KEY_myListId AutoGenerate 0;&lt;BR /&gt;&lt;BR /&gt;Do&lt;BR /&gt;CUSTOM CONNECT TO "Provider=QvRestConnector.exe;url=$(vNextPage)$(vLastId);timeout=30;method=GET;httpProtocol=1.1;isKeepAlive=1;bodyEncoding=UTF-8;sendExpect100Continue=1;autoDetectResponseType=1;checkResponseTypeOnTestConnection=1;keyGenerationStrategy=0;authSchema=ntlm;skipServerCertificateValidation=0;useCertificate=No;certificateStoreLocation=CurrentUser;certificateStoreName=My;addMissingQueryParametersToFinalRequest=0;PaginationType=Custom;allowResponseHeaders=0;allowHttpsOnly=0;XUserId={...};XPassword={...};";&lt;/P&gt;&lt;P&gt;RestConnectorMasterTable:&lt;BR /&gt;SQL SELECT&lt;BR /&gt;"__KEY_feed",&lt;BR /&gt;(SELECT&lt;BR /&gt;(SELECT&lt;BR /&gt;FROM "category"),&lt;BR /&gt;(SELECT&lt;BR /&gt;FROM "link"),&lt;BR /&gt;(SELECT&lt;BR /&gt;FROM "author"),&lt;BR /&gt;(SELECT&lt;BR /&gt;(SELECT&lt;BR /&gt;(SELECT&lt;BR /&gt;FROM "FileSystemObjectType"),&lt;BR /&gt;(SELECT&lt;BR /&gt;"@Content" AS "@Content_u0",&lt;BR /&gt;"__FK_Id"&lt;BR /&gt;FROM "Id" FK "__FK_Id" ContentFieldAlias "@Content_u0"),&lt;BR /&gt;(SELECT&lt;BR /&gt;"@Content" AS "@Content_u1",&lt;BR /&gt;"__FK_Type"&lt;BR /&gt;FROM "Type" FK "__FK_Type" ContentFieldAlias "@Content_u1"),&lt;BR /&gt;(SELECT&lt;BR /&gt;"@Content" AS "@Content_u2",&lt;BR /&gt;"__FK_Description"&lt;BR /&gt;FROM "Description" FK "__FK_Description" ContentFieldAlias "@Content_u2"),&lt;/P&gt;&lt;P&gt;{...}&lt;BR /&gt;FROM "properties" PK "__KEY_properties" FK "__FK_properties")&lt;BR /&gt;FROM "content" PK "__KEY_content" FK "__FK_content")&lt;BR /&gt;FROM "entry" PK "__KEY_entry" FK "__FK_entry")&lt;BR /&gt;FROM XML "feed" PK "__KEY_feed";&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;[Id]:&lt;BR /&gt;LOAD [@Content_u0],&lt;BR /&gt;[__FK_Id] AS [__KEY_properties]&lt;BR /&gt;RESIDENT RestConnectorMasterTable&lt;BR /&gt;WHERE NOT IsNull([__FK_Id]);&lt;BR /&gt;&lt;BR /&gt;maxID:&lt;BR /&gt;LOAD max(@Content_u0) as fMaxID RESIDENT Id;&lt;BR /&gt;LET vLastId = Peek('fMaxID', 0, 'maxID');&lt;BR /&gt;DROP TABLE maxID;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;[Type]:&lt;BR /&gt;LOAD [@Content_u1],&lt;BR /&gt;[__FK_Type] AS [__KEY_properties]&lt;BR /&gt;RESIDENT RestConnectorMasterTable&lt;BR /&gt;WHERE NOT IsNull([__FK_Type]);&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;[Description]:&lt;BR /&gt;LOAD [@Content_u2],&lt;BR /&gt;[__FK_Description] AS [__KEY_properties]&lt;BR /&gt;RESIDENT RestConnectorMasterTable&lt;BR /&gt;WHERE NOT IsNull([__FK_Description]);&lt;BR /&gt;&lt;BR /&gt;{...}&lt;BR /&gt;&lt;BR /&gt;DROP TABLE RestConnectorMasterTable;&lt;BR /&gt;&lt;BR /&gt;tmpTable:&lt;BR /&gt;LOAD [@Content_u0] as [%KEY_myListId], [__KEY_properties] RESIDENT Id;&lt;BR /&gt;LEFT JOIN LOAD [@Content_u1] as [Type], [__KEY_properties] RESIDENT Type;&lt;BR /&gt;LEFT JOIN LOAD [@Content_u2] as [Description], [__KEY_properties] RESIDENT Description;&lt;/P&gt;&lt;P&gt;{...}&lt;/P&gt;&lt;P&gt;Concatenate(myList)&lt;BR /&gt;LOAD * RESIDENT tmpTable;&lt;BR /&gt;DROP TABLE tmpTable;&lt;BR /&gt;&lt;BR /&gt;DROP TABLE Id;&lt;BR /&gt;DROP TABLE Type;&lt;BR /&gt;DROP TABLE Description;&lt;/P&gt;&lt;P&gt;{...}&lt;BR /&gt;&lt;BR /&gt;EXIT DO WHEN ISNULL(vLastId);&lt;BR /&gt;LOOP WHILE NOT IS NULL(vLastId)&lt;BR /&gt;SET ErrorMode = 1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If anyone can tell me how to do it without a loop, directly within the pagination setup of the Connector, that would be even more awesome &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you all very much and hope someone can help me here.&lt;/P&gt;&lt;P&gt;Cheers, Ben&lt;/P&gt;</description>
    <pubDate>Tue, 21 Dec 2021 14:01:50 GMT</pubDate>
    <dc:creator>Benny</dc:creator>
    <dc:date>2021-12-21T14:01:50Z</dc:date>
    <item>
      <title>Pagination with Authentication and XML response</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Pagination-with-Authentication-and-XML-response/m-p/1674743#M7995</link>
      <description>&lt;P&gt;Dear community,&lt;/P&gt;&lt;P&gt;I am struggling with the Rest Connector at the moment.&lt;/P&gt;&lt;P&gt;I want to connect to a SharePoint list that has more than 100 entries. Therefore, the response is split into multiple pages.&lt;/P&gt;&lt;P&gt;The connection itself is working, so if I specify "No Pagination" I get 100 entries as a result.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Because I was not sure how to set the Pagination of SharePoint in QV Connector, I read the maximum ID from the result set and use this in a loop to connect to the next set:&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;1. First request: "url=https://{our page}/_api/Web/Lists(guid'{...}')/items?%24skiptoken=Paged%3dTRUE%26p_ID%3d0"&lt;/P&gt;&lt;P&gt;2. Next request (max ID = 112):&amp;nbsp;"url=https://{our page}/_api/Web/Lists(guid'{...}')/items?%24skiptoken=Paged%3dTRUE%26p_ID%3d112"&lt;/P&gt;&lt;P&gt;And if I check this manually in Chrome, I can see that the next result entry I get is ID = 113.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But if I put this in a loop in QV, the first connection is set and the results are loaded in a table. Then the maximum ID is read into a variable, which is still working (var = 112).&lt;/P&gt;&lt;P&gt;But after the next connection, which uses the url from 2. above (I checked this in Debug mode - the url is correct), I still get the same result set as in the first query and my maximum ID again is 112... I tried this also with PaginationMode=Custom (see below), but to no avail.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, can someone tell me if I miss some logic here? Here is the full code (shortened and censored):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SET vNextPage = https://{page}/_api/Web/Lists(guid'{...}')/items?%24skiptoken=Paged%3dTRUE%26p_ID%3d;&lt;BR /&gt;LET vLastId = 0;&lt;BR /&gt;SET ErrorMode = 0;&lt;BR /&gt;&lt;BR /&gt;myList:&lt;BR /&gt;LOAD 0 as %KEY_myListId AutoGenerate 0;&lt;BR /&gt;&lt;BR /&gt;Do&lt;BR /&gt;CUSTOM CONNECT TO "Provider=QvRestConnector.exe;url=$(vNextPage)$(vLastId);timeout=30;method=GET;httpProtocol=1.1;isKeepAlive=1;bodyEncoding=UTF-8;sendExpect100Continue=1;autoDetectResponseType=1;checkResponseTypeOnTestConnection=1;keyGenerationStrategy=0;authSchema=ntlm;skipServerCertificateValidation=0;useCertificate=No;certificateStoreLocation=CurrentUser;certificateStoreName=My;addMissingQueryParametersToFinalRequest=0;PaginationType=Custom;allowResponseHeaders=0;allowHttpsOnly=0;XUserId={...};XPassword={...};";&lt;/P&gt;&lt;P&gt;RestConnectorMasterTable:&lt;BR /&gt;SQL SELECT&lt;BR /&gt;"__KEY_feed",&lt;BR /&gt;(SELECT&lt;BR /&gt;(SELECT&lt;BR /&gt;FROM "category"),&lt;BR /&gt;(SELECT&lt;BR /&gt;FROM "link"),&lt;BR /&gt;(SELECT&lt;BR /&gt;FROM "author"),&lt;BR /&gt;(SELECT&lt;BR /&gt;(SELECT&lt;BR /&gt;(SELECT&lt;BR /&gt;FROM "FileSystemObjectType"),&lt;BR /&gt;(SELECT&lt;BR /&gt;"@Content" AS "@Content_u0",&lt;BR /&gt;"__FK_Id"&lt;BR /&gt;FROM "Id" FK "__FK_Id" ContentFieldAlias "@Content_u0"),&lt;BR /&gt;(SELECT&lt;BR /&gt;"@Content" AS "@Content_u1",&lt;BR /&gt;"__FK_Type"&lt;BR /&gt;FROM "Type" FK "__FK_Type" ContentFieldAlias "@Content_u1"),&lt;BR /&gt;(SELECT&lt;BR /&gt;"@Content" AS "@Content_u2",&lt;BR /&gt;"__FK_Description"&lt;BR /&gt;FROM "Description" FK "__FK_Description" ContentFieldAlias "@Content_u2"),&lt;/P&gt;&lt;P&gt;{...}&lt;BR /&gt;FROM "properties" PK "__KEY_properties" FK "__FK_properties")&lt;BR /&gt;FROM "content" PK "__KEY_content" FK "__FK_content")&lt;BR /&gt;FROM "entry" PK "__KEY_entry" FK "__FK_entry")&lt;BR /&gt;FROM XML "feed" PK "__KEY_feed";&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;[Id]:&lt;BR /&gt;LOAD [@Content_u0],&lt;BR /&gt;[__FK_Id] AS [__KEY_properties]&lt;BR /&gt;RESIDENT RestConnectorMasterTable&lt;BR /&gt;WHERE NOT IsNull([__FK_Id]);&lt;BR /&gt;&lt;BR /&gt;maxID:&lt;BR /&gt;LOAD max(@Content_u0) as fMaxID RESIDENT Id;&lt;BR /&gt;LET vLastId = Peek('fMaxID', 0, 'maxID');&lt;BR /&gt;DROP TABLE maxID;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;[Type]:&lt;BR /&gt;LOAD [@Content_u1],&lt;BR /&gt;[__FK_Type] AS [__KEY_properties]&lt;BR /&gt;RESIDENT RestConnectorMasterTable&lt;BR /&gt;WHERE NOT IsNull([__FK_Type]);&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;[Description]:&lt;BR /&gt;LOAD [@Content_u2],&lt;BR /&gt;[__FK_Description] AS [__KEY_properties]&lt;BR /&gt;RESIDENT RestConnectorMasterTable&lt;BR /&gt;WHERE NOT IsNull([__FK_Description]);&lt;BR /&gt;&lt;BR /&gt;{...}&lt;BR /&gt;&lt;BR /&gt;DROP TABLE RestConnectorMasterTable;&lt;BR /&gt;&lt;BR /&gt;tmpTable:&lt;BR /&gt;LOAD [@Content_u0] as [%KEY_myListId], [__KEY_properties] RESIDENT Id;&lt;BR /&gt;LEFT JOIN LOAD [@Content_u1] as [Type], [__KEY_properties] RESIDENT Type;&lt;BR /&gt;LEFT JOIN LOAD [@Content_u2] as [Description], [__KEY_properties] RESIDENT Description;&lt;/P&gt;&lt;P&gt;{...}&lt;/P&gt;&lt;P&gt;Concatenate(myList)&lt;BR /&gt;LOAD * RESIDENT tmpTable;&lt;BR /&gt;DROP TABLE tmpTable;&lt;BR /&gt;&lt;BR /&gt;DROP TABLE Id;&lt;BR /&gt;DROP TABLE Type;&lt;BR /&gt;DROP TABLE Description;&lt;/P&gt;&lt;P&gt;{...}&lt;BR /&gt;&lt;BR /&gt;EXIT DO WHEN ISNULL(vLastId);&lt;BR /&gt;LOOP WHILE NOT IS NULL(vLastId)&lt;BR /&gt;SET ErrorMode = 1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If anyone can tell me how to do it without a loop, directly within the pagination setup of the Connector, that would be even more awesome &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you all very much and hope someone can help me here.&lt;/P&gt;&lt;P&gt;Cheers, Ben&lt;/P&gt;</description>
      <pubDate>Tue, 21 Dec 2021 14:01:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Pagination-with-Authentication-and-XML-response/m-p/1674743#M7995</guid>
      <dc:creator>Benny</dc:creator>
      <dc:date>2021-12-21T14:01:50Z</dc:date>
    </item>
    <item>
      <title>Re: Pagination with Authentication and XML response</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Pagination-with-Authentication-and-XML-response/m-p/1675688#M7996</link>
      <description>&lt;P&gt;Hi again,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I solved it by using "WITH CONNECTION". I realised I don't even need to specify the Authentication every time, so I connect once with a regular "Custom CONNECT" and then use variables for the IDs in the WITH CONNECT statement.&lt;/P&gt;&lt;P&gt;Cheers, Ben&lt;/P&gt;</description>
      <pubDate>Fri, 14 Feb 2020 08:37:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Pagination-with-Authentication-and-XML-response/m-p/1675688#M7996</guid>
      <dc:creator>Benny</dc:creator>
      <dc:date>2020-02-14T08:37:03Z</dc:date>
    </item>
  </channel>
</rss>

