<?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 Re: Qlikview - creating a loop for an API call in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Qlikview-creating-a-loop-for-an-API-call/m-p/1402613#M611586</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for your help and ideas! &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 08 Nov 2017 14:53:01 GMT</pubDate>
    <dc:creator>twanqlik</dc:creator>
    <dc:date>2017-11-08T14:53:01Z</dc:date>
    <item>
      <title>Qlikview - creating a loop for an API call</title>
      <link>https://community.qlik.com/t5/QlikView/Qlikview-creating-a-loop-for-an-API-call/m-p/1402607#M611580</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying to create a loop for an API Call to Eloqua and i can use some help for this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Eloqua Rest API returns 1000 records per page.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The URL looks like below for the first 1000 records:&lt;/P&gt;&lt;P&gt;&lt;A href="https://secure.p01.eloqua.com/api/REST/2.0/data/contacts?count=3&amp;amp;page=1" title="https://secure.p01.eloqua.com/api/REST/2.0/data/contacts?count=3&amp;amp;page=1"&gt;https://secure.p01.eloqua.com/api/REST/2.0/data/contacts?count=1000&amp;amp;page=1&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;In case there are more than 1000 records that you want to extract, you need to change the page number:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;The below URL will return 1001-2000 records&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;A href="https://secure.p01.eloqua.com/api/REST/2.0/data/contacts?count=3&amp;amp;page=1" style="font-size: 13.3333px;" title="https://secure.p01.eloqua.com/api/REST/2.0/data/contacts?count=3&amp;amp;page=1"&gt;https://secure.p01.eloqua.com/api/REST/2.0/data/contacts?count=1000&amp;amp;page=2&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;However, you don't know how many pages there are, hence, the API call needs to stop when the API call doesn't return any records. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Therefore, for the API call i need to create a loop where the pagenumber is 'x', and the call needs to stop when the call returns with 0 records. Till then the API call need to extract data and place it in a table. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; I simply don't know how to write this, can someone help me with this? &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Nov 2017 15:51:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Qlikview-creating-a-loop-for-an-API-call/m-p/1402607#M611580</guid>
      <dc:creator>twanqlik</dc:creator>
      <dc:date>2017-11-02T15:51:35Z</dc:date>
    </item>
    <item>
      <title>Re: Qlikview - creating a loop for an API call</title>
      <link>https://community.qlik.com/t5/QlikView/Qlikview-creating-a-loop-for-an-API-call/m-p/1402608#M611581</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I recently had the same challenge, but in my case it was for airTable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I suggest you have a look at the "offset" parameter in the query string as referred to in the link:&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.oracle.com/cloud/latest/marketingcs_gs/OMCAB/Developers/BulkAPI/Tutorials/Retrieving_Large_Volumes.htm" style="font-size: 10pt;" title="https://docs.oracle.com/cloud/latest/marketingcs_gs/OMCAB/Developers/BulkAPI/Tutorials/Retrieving_Large_Volumes.htm"&gt;https://docs.oracle.com/cloud/latest/marketingcs_gs/OMCAB/Developers/BulkAPI/Tutorials/Retrieving_Large_Volumes.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The offset value should be returned on the GET call and you can use this in your loop to return the next page's records. The trick you need to apply in your loop is that when the offset value is null, it means that there are no more pages after the current load, which means you need to end the loop after that iteration,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a look at the example I'm pasting, maybe this can be off some help for you to apply the same logic to your script, you will see that after every loop I write out a qvd with the loop iteration (variable i) as the suffix. After you finish the loop process, you simply LOAD * all the qvd's to get all the data in the same table. Note that I never do more than 11 iterations, but you can change the for i = 0 to 100000000 if you need to&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helped a bit to steer you in the right direction&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jan-Hendrik&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Nov 2017 21:17:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Qlikview-creating-a-loop-for-an-API-call/m-p/1402608#M611581</guid>
      <dc:creator>qlikconsult</dc:creator>
      <dc:date>2017-11-03T21:17:16Z</dc:date>
    </item>
    <item>
      <title>Re: Qlikview - creating a loop for an API call</title>
      <link>https://community.qlik.com/t5/QlikView/Qlikview-creating-a-loop-for-an-API-call/m-p/1402609#M611582</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;From the documentation I see that Eloqua's offset might work different, using for example 1000 to indicate retrieving records 1000 to 1999, maybe you can change the logic a bit to say that if no data is retrieved or if the actual nr of records retrieved is less than the limit parameter nr of records, then exit the loop&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Nov 2017 21:27:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Qlikview-creating-a-loop-for-an-API-call/m-p/1402609#M611582</guid>
      <dc:creator>qlikconsult</dc:creator>
      <dc:date>2017-11-03T21:27:37Z</dc:date>
    </item>
    <item>
      <title>Re: Qlikview - creating a loop for an API call</title>
      <link>https://community.qlik.com/t5/QlikView/Qlikview-creating-a-loop-for-an-API-call/m-p/1402610#M611583</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;to check how many rows are in the previously loaded table, use the NoOfRows function&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.qlik.com/en-US/qlikview/12.1/Subsystems/Client/Content/Scripting/TableFunctions/NoOfRows.htm" style="font-size: 10pt;" title="http://help.qlik.com/en-US/qlikview/12.1/Subsystems/Client/Content/Scripting/TableFunctions/NoOfRows.htm"&gt;http://help.qlik.com/en-US/qlikview/12.1/Subsystems/Client/Content/Scripting/TableFunctions/NoOfRows.htm&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Nov 2017 21:45:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Qlikview-creating-a-loop-for-an-API-call/m-p/1402610#M611583</guid>
      <dc:creator>qlikconsult</dc:creator>
      <dc:date>2017-11-03T21:45:57Z</dc:date>
    </item>
    <item>
      <title>Re: Qlikview - creating a loop for an API call</title>
      <link>https://community.qlik.com/t5/QlikView/Qlikview-creating-a-loop-for-an-API-call/m-p/1402611#M611584</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I also think that this is the way that you should write the logic but i'm no expert in that and therefore i'm struggling with it &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I currently did:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) One call (count =1) to retrieve the Total amount of records&lt;/P&gt;&lt;P&gt;2) Use this total value to calculate how many pages i need to extract.&lt;/P&gt;&lt;P&gt;3) Create a second API call and use the number of pages in a For Loop to extract the data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This works but is not ideal because i need to make one extra API call for it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-------------&lt;/P&gt;&lt;P&gt;API connection:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RestConnectorMasterTable:&lt;/P&gt;&lt;P&gt;SQL SELECT&lt;/P&gt;&lt;P&gt;"total"&lt;/P&gt;&lt;P&gt;FROM JSON (wrap on) "root";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[Total_Records]:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;[total],&lt;/P&gt;&lt;P&gt;ceil(total/$(Pagesize)) as Pages&lt;/P&gt;&lt;P&gt;RESIDENT RestConnectorMasterTable;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET Pages = peek('Pages');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Start For Loop:&lt;/P&gt;&lt;P&gt;for a=1 to $(Pages)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RestConnectorMasterTable:&lt;/P&gt;&lt;P&gt;SQL SELECT&lt;/P&gt;&lt;P&gt;.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Etc.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Nov 2017 08:59:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Qlikview-creating-a-loop-for-an-API-call/m-p/1402611#M611584</guid>
      <dc:creator>twanqlik</dc:creator>
      <dc:date>2017-11-06T08:59:42Z</dc:date>
    </item>
    <item>
      <title>Re: Qlikview - creating a loop for an API call</title>
      <link>https://community.qlik.com/t5/QlikView/Qlikview-creating-a-loop-for-an-API-call/m-p/1402612#M611585</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;make sense what you are doing,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can drop the tables (as shown in bold below), so that you are only left with the populated variable which you need for your loop api call - that's the only other contrinbution I can make&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;[Total_Records]:&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;LOAD&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;[total],&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;ceil(total/$(Pagesize)) as Pages&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;RESIDENT RestConnectorMasterTable;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;drop table &lt;/STRONG&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;STRONG&gt;RestConnectorMasterTable;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;LET Pages = peek('Pages');&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;drop table &lt;/STRONG&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;STRONG&gt;[Total_Records];&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Nov 2017 10:15:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Qlikview-creating-a-loop-for-an-API-call/m-p/1402612#M611585</guid>
      <dc:creator>qlikconsult</dc:creator>
      <dc:date>2017-11-06T10:15:39Z</dc:date>
    </item>
    <item>
      <title>Re: Qlikview - creating a loop for an API call</title>
      <link>https://community.qlik.com/t5/QlikView/Qlikview-creating-a-loop-for-an-API-call/m-p/1402613#M611586</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for your help and ideas! &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Nov 2017 14:53:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Qlikview-creating-a-loop-for-an-API-call/m-p/1402613#M611586</guid>
      <dc:creator>twanqlik</dc:creator>
      <dc:date>2017-11-08T14:53:01Z</dc:date>
    </item>
    <item>
      <title>Re: Qlikview - creating a loop for an API call</title>
      <link>https://community.qlik.com/t5/QlikView/Qlikview-creating-a-loop-for-an-API-call/m-p/1402614#M611587</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;pleasure&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Nov 2017 14:56:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Qlikview-creating-a-loop-for-an-API-call/m-p/1402614#M611587</guid>
      <dc:creator>qlikconsult</dc:creator>
      <dc:date>2017-11-08T14:56:34Z</dc:date>
    </item>
    <item>
      <title>Re: Qlikview - creating a loop for an API call</title>
      <link>https://community.qlik.com/t5/QlikView/Qlikview-creating-a-loop-for-an-API-call/m-p/2462795#M1225821</link>
      <description>&lt;P&gt;As an addition to this topic, I'm excited to share my latest tutorial on integrating Asana with Qlik Cloud using REST APIs!&lt;/P&gt;
&lt;P&gt;In this step-by-step guide, you'll learn:&lt;BR /&gt;- How to use Asana REST APIs with Postman&lt;BR /&gt;- Creating REST Data Connections in Qlik Cloud&lt;BR /&gt;- Extracting data from Asana and saving as Parquet files&lt;BR /&gt;- Enhancing connections with custom parameters and pagination&lt;/P&gt;
&lt;P&gt;Check out the full video on YouTube:&lt;BR /&gt;&lt;STRONG&gt;Integrate Asana with Qlik Cloud Using REST APIs: A Step-by-Step Guide&lt;/STRONG&gt;&lt;BR /&gt;&lt;A href="https://youtu.be/lFwar30BNkQ?si=UZoM_x9L5amdJSnf" target="_blank"&gt;https://youtu.be/lFwar30BNkQ?si=UZoM_x9L5amdJSnf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Mark Costa&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 15 Jun 2024 22:16:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Qlikview-creating-a-loop-for-an-API-call/m-p/2462795#M1225821</guid>
      <dc:creator>marksouzacosta</dc:creator>
      <dc:date>2024-06-15T22:16:28Z</dc:date>
    </item>
  </channel>
</rss>

