<?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: How to do paginaton for Rest api in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/How-to-do-paginaton-for-Rest-api/m-p/2373917#M136583</link>
    <description>&lt;P&gt;The step by step method I suggested will work. You just need to change step 5 to calculate how many records you have received and use that to change your URL or stop the tLoop.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 02 Aug 2018 12:02:06 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-08-02T12:02:06Z</dc:date>
    <item>
      <title>How to do paginaton for Rest api</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-do-paginaton-for-Rest-api/m-p/2373913#M136579</link>
      <description>Hey Guys,&lt;BR /&gt;My requiremnt is I need to get Data from Rest api per pages and one page contain 250 records. I know I need to also iteration for this. But I dont how store value in variable and make counter. Can someone help on this.&lt;BR /&gt;&lt;BR /&gt;Any help much appricated.</description>
      <pubDate>Sun, 29 Jul 2018 12:15:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-do-paginaton-for-Rest-api/m-p/2373913#M136579</guid>
      <dc:creator>arpiitv</dc:creator>
      <dc:date>2018-07-29T12:15:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to do paginaton for Rest api</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-do-paginaton-for-Rest-api/m-p/2373914#M136580</link>
      <description>&lt;P&gt;Essentially you need to follow this process.....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1) Create a globalMap variable to hold your webservice call URL. Do this in a tJava.&lt;/P&gt;&lt;P&gt;2) Connect the tJava to a tLoop using an OnSubJobOk link.&lt;/P&gt;&lt;P&gt;3) Set the loop to be based on the presence of a URL value in globalMap. While globalMap.get("url")!=null, for example.&lt;/P&gt;&lt;P&gt;4) Connect your tLoop to whatever web service component you want to use.&lt;/P&gt;&lt;P&gt;5) After the webservice call, use a tExtractXMLField component to retrieve your data and the pagination URL. Put the pagination URL into the globalMap variable. If there is no pagination URL (because it is the last page), set it to null.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is a high level explanation of how to achieve this with A LOT of assumptions as to how your web service works. You should be able to tailor this to your web service.&lt;/P&gt;</description>
      <pubDate>Sun, 29 Jul 2018 20:33:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-do-paginaton-for-Rest-api/m-p/2373914#M136580</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-07-29T20:33:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to do paginaton for Rest api</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-do-paginaton-for-Rest-api/m-p/2373915#M136581</link>
      <description>How many records the page could have? Is it always in a range such as 1-500? or uncertain?</description>
      <pubDate>Wed, 01 Aug 2018 04:38:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-do-paginaton-for-Rest-api/m-p/2373915#M136581</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-08-01T04:38:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to do paginaton for Rest api</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-do-paginaton-for-Rest-api/m-p/2373916#M136582</link>
      <description>&lt;P&gt;The page has always&amp;nbsp;250 records, Its fix.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Aug 2018 04:56:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-do-paginaton-for-Rest-api/m-p/2373916#M136582</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-08-01T04:56:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to do paginaton for Rest api</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-do-paginaton-for-Rest-api/m-p/2373917#M136583</link>
      <description>&lt;P&gt;The step by step method I suggested will work. You just need to change step 5 to calculate how many records you have received and use that to change your URL or stop the tLoop.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Aug 2018 12:02:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-do-paginaton-for-Rest-api/m-p/2373917#M136583</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-08-02T12:02:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to do paginaton for Rest api</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-do-paginaton-for-Rest-api/m-p/2373918#M136584</link>
      <description>&lt;P&gt;I have knocked up an example job. This does not use a real REST service, because I couldn't find one suitable (for pagination), but it should give you an idea. Look at the code in the tJava components (it is described there) and look at the tLoop config. You will have to work some of the logic out for yourself with your service (working out how many records are returned, how many are left, etc), but the logic shown in this example should easily be able to be extrapolated from.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The example was written in Talend v6.5.1. If you are using a younger version, download anything above 6.5.1 and you can look at it there.&lt;/P&gt;&lt;BR /&gt;&lt;A href="https://community.qlik.com/legacyfs/online/tlnd_dw_files/0683p000009LtOc"&gt;PaginationExample.zip&lt;/A&gt;</description>
      <pubDate>Sat, 04 Aug 2018 14:50:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-do-paginaton-for-Rest-api/m-p/2373918#M136584</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-08-04T14:50:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to do paginaton for Rest api</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-do-paginaton-for-Rest-api/m-p/2373919#M136585</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt; 
&lt;P&gt;I am doing the same thing in one job, but when i am extracting json data from tExtractJson using Xpath and there was no response from the RestAPI link, it should extract null values, and my loop should end after that. Please see the Below image -&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JsonExtract.PNG" style="width: 928px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M8It.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/135733i9A222AEFF0A87DC0/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M8It.png" alt="0683p000009M8It.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;This is how i am extracting values. The response from postman is below :-&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Postman_Response.PNG" style="width: 477px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M8Iy.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/152279i619FD6D9F057077A/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M8Iy.png" alt="0683p000009M8Iy.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;And ModifyURL( tJavaflex) component i am modifying my URL and storing the offset value coming from tExtractJson. offset value is used to end the loop.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ModifyURL.PNG" style="width: 843px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M8J3.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/139227i7F8FC65E3F69B505/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M8J3.png" alt="0683p000009M8J3.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;But as i am not getting any values, offset should be null and loop should end. But in this case loop is not getting end. It's keep on iterating, i think because V_loop value is not getting set as false.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Please see the below response in tlogRow : -&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="logRowValues.PNG" style="width: 949px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M8J8.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/156315iC394AFFD013B4B52/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M8J8.png" alt="0683p000009M8J8.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;tlogRow_6 is the values i am getting after tExtractJson.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Setting_loop.PNG" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M845.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/157153i3B5DA43E8A04840C/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M845.png" alt="0683p000009M845.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;This is how i am setting my loop.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Also i am not able to see, my tJavaflex println values on the console. I don't know why, please help me in this.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Thanks,&lt;/P&gt; 
&lt;P&gt;Abhishek&lt;/P&gt;</description>
      <pubDate>Fri, 29 Nov 2019 07:49:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-do-paginaton-for-Rest-api/m-p/2373919#M136585</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-11-29T07:49:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to do paginaton for Rest api</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-do-paginaton-for-Rest-api/m-p/2373920#M136586</link>
      <description>&lt;P&gt;Why do you have this code....&lt;/P&gt; 
&lt;PRE&gt;if(context.offset==null){
......&lt;/PRE&gt; 
&lt;P&gt;....it looks like it should be more like....&lt;/P&gt; 
&lt;PRE&gt;if(row18.offset==null){
.....&lt;/PRE&gt; 
&lt;P&gt;This might not be the only issue. If your code compiles and runs, it means that you have a context variable called "offset". What is that supposed to do and where is it set?&lt;/P&gt;</description>
      <pubDate>Fri, 29 Nov 2019 11:07:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-do-paginaton-for-Rest-api/m-p/2373920#M136586</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-11-29T11:07:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to do paginaton for Rest api</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-do-paginaton-for-Rest-api/m-p/2373921#M136587</link>
      <description>&lt;P&gt;Hhi&amp;nbsp;&lt;A href="https://community.qlik.com/s/profile/005390000069RuGAAU"&gt;@rhall&lt;/A&gt;&amp;nbsp;,&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Your job has been very useful to me and I've tried to emulate it with a real REST API:&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Captura de pantalla 2020-06-18 a las 13.57.56.png" style="width: 542px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MaPJ.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/151936i374457BED204F461/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MaPJ.png" alt="0683p000009MaPJ.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;However, I'm facing with a strange error:&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;In my tJava_4 component I've configured the URL and the initial condition ("records") to get into the loop:&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Captura de pantalla 2020-06-18 a las 14.05.04.png" style="width: 710px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MaPO.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/135639iA42B08B4235BDC2A/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MaPO.png" alt="0683p000009MaPO.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;In tLoop_2 I set the condition to stay in the loop:&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Captura de pantalla 2020-06-18 a las 14.07.50.png" style="width: 669px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MaPT.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/149581i5F010AF6D93FF01C/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MaPT.png" alt="0683p000009MaPT.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Next, I set the REST API configuration:&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Captura de pantalla 2020-06-18 a las 14.13.06.png" style="width: 732px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009Ma8Y.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/128344i4FA9CF83A14BB4AD/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009Ma8Y.png" alt="0683p000009Ma8Y.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;In tJava_5, at last, I'm doing some debugging:&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Captura de pantalla 2020-06-18 a las 14.17.47.png" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MaPY.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/132736iC53990DCF66A67B3/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MaPY.png" alt="0683p000009MaPY.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;As you can see, I've commented the last condition because it is causing an error, because row14.total is null in the first iteration. I don't know why this is happening, but when I execute the whole job I realize that this is the real behaviour:&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Captura de pantalla 2020-06-18 a las 14.19.49 1.png" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MaPK.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/154893i3505206C7E893850/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MaPK.png" alt="0683p000009MaPK.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;As you can see, in the first iteration the Body returned is null, and in the second iteration I start receiving data. I've also checked the URL in the first iteration with Postman and, however, I see results:&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Captura de pantalla 2020-06-18 a las 14.22.30.png" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MaPi.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/146857i8046449E35022DD8/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MaPi.png" alt="0683p000009MaPi.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;So, am I not taking something into account when designing this job? In the first iteration, when I get null value for row14.total, Talend generates an error and the job breaks. I don't understand why I'm starting to get data in the second iteration instead of the first one.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jun 2020 13:26:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-do-paginaton-for-Rest-api/m-p/2373921#M136587</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-06-18T13:26:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to do paginaton for Rest api</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-do-paginaton-for-Rest-api/m-p/2373922#M136588</link>
      <description>&lt;P&gt;I *think* that this might be caused by you using the tJava and not a tJavaFlex. The tJava is not intended to receive or send out "rows". If you take a look at your second service call and look at the page index, it says 1. I *think* this might be the response from the first the call. If you replace the tJava with a tJavaFlex and configure it's schema appropriately, you can use the same code.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Another thing to point out, in the code you commented out it looks like you are referring to section of the JSON body. Before you can make use of the "total" value, you will need to extract it from the JSON using a tExtractJSONFields component.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jun 2020 13:55:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-do-paginaton-for-Rest-api/m-p/2373922#M136588</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-06-19T13:55:23Z</dc:date>
    </item>
  </channel>
</rss>

