<?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>article How to implement pagination using Call Url block in an automation in Official Support Articles</title>
    <link>https://community.qlik.com/t5/Official-Support-Articles/How-to-implement-pagination-using-Call-Url-block-in-an/ta-p/1879458</link>
    <description>&lt;P&gt;&lt;SPAN&gt;This article explains how to handle pagination using Call URL block&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Here we are mainly discussing two different types of pagination&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;STRONG&gt;Page-based Pagination&lt;/STRONG&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;Cursor-based Pagination&lt;/STRONG&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Basically, the call URL block will only execute once or do one API call. It &lt;SPAN&gt;does not support pagination by itself, but you can construct the next page manually by checking if there is a Next Link attribute (cursor-based pagination) or if there are any other attributes indicating the presence of more records (page-based pagination)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;For page-based pagination, let's take an example of Zoho CRM rest API. Say for eg, We are using call URL block to get all contacts from Zoho crm&lt;/P&gt;
&lt;P&gt;The first call always lists out x number of items. We have to construct a loop in order to perform pagination.Please follow the below steps&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Initialize a variable with name count and set the value to 0&lt;/LI&gt;
&lt;LI&gt;If the page should be started from 1, use the same count variable and add 1 as a value&lt;/LI&gt;
&lt;LI&gt;Skip the above step if the page should&amp;nbsp; be started from 0&lt;/LI&gt;
&lt;LI&gt;Use '&lt;SPAN&gt;Go To Label&lt;/SPAN&gt;' block&amp;nbsp;&lt;SPAN&gt;which allows you to jump to another section in your automation&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;On the right side of automation, use the 'Label' block&lt;/LI&gt;
&lt;LI&gt;Drag and drop Call URL block and fill in appropriate fields&lt;/LI&gt;
&lt;LI&gt;In the Call URL block, there will be 2 query params called page(indicates page number) and per_page(indicates the size of the page)&lt;/LI&gt;
&lt;LI&gt;Page value should equal to&amp;nbsp;{$.count}&lt;/LI&gt;
&lt;LI&gt;Increment count variable by 1&lt;/LI&gt;
&lt;LI&gt;Add a condition block to check if the 'more_records' attribute from the response of the call URL block is true&lt;/LI&gt;
&lt;LI&gt;If it's true, continue to execute the call URL block&amp;nbsp; by using 'Go To Label' block&lt;/LI&gt;
&lt;LI&gt;If there are no more records, break the loop to stop pagination&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="page-base-pagination-flow.PNG" style="width: 0px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/69976i99955A55C339896E/image-size/small?v=v2&amp;amp;px=200" width="0" height="0" role="button" title="page-base-pagination-flow.PNG" alt="page-base-pagination-flow.PNG" /&gt;&lt;/span&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Please find&lt;SPAN&gt;&amp;nbsp;the attached JSON file containing an example automation workspace demonstrating page-based pagination using call URL block&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;For cursor-based pagination, let's go over an example of HubSpot rest API. Say for eg, We are using call URL block to get the list of companies from Hubspot&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Steps to follow&lt;/SPAN&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;SPAN&gt;Beneath the start block use the&amp;nbsp;&lt;/SPAN&gt;'&lt;SPAN&gt;Go To Label&lt;/SPAN&gt;' block&amp;nbsp;&lt;SPAN&gt;which allows you to jump to another section in your automation&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;On the right-hand side, use the 'Label' block&lt;/LI&gt;
&lt;LI&gt;Add Call URL block and fill in appropriate fields&lt;/LI&gt;
&lt;LI&gt;In the Call URL block, there will be 2 query params called after(indicates cursor value to go to the next page) and limit(indicates the size of the page)&lt;/LI&gt;
&lt;LI&gt;During the first run of the call URL block, the after parameter (cursor) value will be null&lt;/LI&gt;
&lt;LI&gt;Add a condition block to check if the&amp;nbsp;'paging.next.link' attribute from the response of the call URL block is not empty&lt;/LI&gt;
&lt;LI&gt;Add a custom code block and write coding stuff in order to fetch the cursor value from the response of the call URL block&lt;/LI&gt;
&lt;LI&gt;If the condition is true, execute the call URL block until the paging stops&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="cursor-based-pagination.PNG" style="width: 396px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/69978i3E3C8AC1ACD414E3/image-dimensions/396x228?v=v2" width="396" height="228" role="button" title="cursor-based-pagination.PNG" alt="cursor-based-pagination.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Please find&lt;SPAN&gt;&amp;nbsp;the attached JSON file containing an example automation workspace demonstrating cursor-based pagination using call URL block&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Follow the steps provided in this article&amp;nbsp;&lt;A title="Upload Blend Workspace" href="https://community.qlik.com/t5/Knowledge-Base/How-to-upload-and-download-blends/ta-p/1781602" target="_self"&gt;Upload Automation Workspace&lt;/A&gt;&amp;nbsp; to import the automation from shared JSON file&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 11 Jan 2022 12:27:15 GMT</pubDate>
    <dc:creator>AfeefaTk</dc:creator>
    <dc:date>2022-01-11T12:27:15Z</dc:date>
    <item>
      <title>How to implement pagination using Call Url block in an automation</title>
      <link>https://community.qlik.com/t5/Official-Support-Articles/How-to-implement-pagination-using-Call-Url-block-in-an/ta-p/1879458</link>
      <description>&lt;P&gt;&lt;SPAN&gt;This article explains how to handle pagination using Call URL block&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Here we are mainly discussing two different types of pagination&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;STRONG&gt;Page-based Pagination&lt;/STRONG&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;Cursor-based Pagination&lt;/STRONG&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Basically, the call URL block will only execute once or do one API call. It &lt;SPAN&gt;does not support pagination by itself, but you can construct the next page manually by checking if there is a Next Link attribute (cursor-based pagination) or if there are any other attributes indicating the presence of more records (page-based pagination)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;For page-based pagination, let's take an example of Zoho CRM rest API. Say for eg, We are using call URL block to get all contacts from Zoho crm&lt;/P&gt;
&lt;P&gt;The first call always lists out x number of items. We have to construct a loop in order to perform pagination.Please follow the below steps&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Initialize a variable with name count and set the value to 0&lt;/LI&gt;
&lt;LI&gt;If the page should be started from 1, use the same count variable and add 1 as a value&lt;/LI&gt;
&lt;LI&gt;Skip the above step if the page should&amp;nbsp; be started from 0&lt;/LI&gt;
&lt;LI&gt;Use '&lt;SPAN&gt;Go To Label&lt;/SPAN&gt;' block&amp;nbsp;&lt;SPAN&gt;which allows you to jump to another section in your automation&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;On the right side of automation, use the 'Label' block&lt;/LI&gt;
&lt;LI&gt;Drag and drop Call URL block and fill in appropriate fields&lt;/LI&gt;
&lt;LI&gt;In the Call URL block, there will be 2 query params called page(indicates page number) and per_page(indicates the size of the page)&lt;/LI&gt;
&lt;LI&gt;Page value should equal to&amp;nbsp;{$.count}&lt;/LI&gt;
&lt;LI&gt;Increment count variable by 1&lt;/LI&gt;
&lt;LI&gt;Add a condition block to check if the 'more_records' attribute from the response of the call URL block is true&lt;/LI&gt;
&lt;LI&gt;If it's true, continue to execute the call URL block&amp;nbsp; by using 'Go To Label' block&lt;/LI&gt;
&lt;LI&gt;If there are no more records, break the loop to stop pagination&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="page-base-pagination-flow.PNG" style="width: 0px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/69976i99955A55C339896E/image-size/small?v=v2&amp;amp;px=200" width="0" height="0" role="button" title="page-base-pagination-flow.PNG" alt="page-base-pagination-flow.PNG" /&gt;&lt;/span&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Please find&lt;SPAN&gt;&amp;nbsp;the attached JSON file containing an example automation workspace demonstrating page-based pagination using call URL block&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;For cursor-based pagination, let's go over an example of HubSpot rest API. Say for eg, We are using call URL block to get the list of companies from Hubspot&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Steps to follow&lt;/SPAN&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;SPAN&gt;Beneath the start block use the&amp;nbsp;&lt;/SPAN&gt;'&lt;SPAN&gt;Go To Label&lt;/SPAN&gt;' block&amp;nbsp;&lt;SPAN&gt;which allows you to jump to another section in your automation&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;On the right-hand side, use the 'Label' block&lt;/LI&gt;
&lt;LI&gt;Add Call URL block and fill in appropriate fields&lt;/LI&gt;
&lt;LI&gt;In the Call URL block, there will be 2 query params called after(indicates cursor value to go to the next page) and limit(indicates the size of the page)&lt;/LI&gt;
&lt;LI&gt;During the first run of the call URL block, the after parameter (cursor) value will be null&lt;/LI&gt;
&lt;LI&gt;Add a condition block to check if the&amp;nbsp;'paging.next.link' attribute from the response of the call URL block is not empty&lt;/LI&gt;
&lt;LI&gt;Add a custom code block and write coding stuff in order to fetch the cursor value from the response of the call URL block&lt;/LI&gt;
&lt;LI&gt;If the condition is true, execute the call URL block until the paging stops&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="cursor-based-pagination.PNG" style="width: 396px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/69978i3E3C8AC1ACD414E3/image-dimensions/396x228?v=v2" width="396" height="228" role="button" title="cursor-based-pagination.PNG" alt="cursor-based-pagination.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Please find&lt;SPAN&gt;&amp;nbsp;the attached JSON file containing an example automation workspace demonstrating cursor-based pagination using call URL block&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Follow the steps provided in this article&amp;nbsp;&lt;A title="Upload Blend Workspace" href="https://community.qlik.com/t5/Knowledge-Base/How-to-upload-and-download-blends/ta-p/1781602" target="_self"&gt;Upload Automation Workspace&lt;/A&gt;&amp;nbsp; to import the automation from shared JSON file&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jan 2022 12:27:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Official-Support-Articles/How-to-implement-pagination-using-Call-Url-block-in-an/ta-p/1879458</guid>
      <dc:creator>AfeefaTk</dc:creator>
      <dc:date>2022-01-11T12:27:15Z</dc:date>
    </item>
  </channel>
</rss>

