<?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 Accessing the extacted JSON Values with java to paginate REST call/end Loop in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Accessing-the-extacted-JSON-Values-with-java-to-paginate-REST/m-p/2222716#M16192</link>
    <description>&lt;P&gt;Hi There,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;my first real day with Talend Opern Studio, so please be patient with me &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;The Task:&lt;/P&gt; 
&lt;P&gt;Call a REST API with three parameters: starte_date and end_date (current_date) as well as an id for requesting the next rows if there are more than 500. The API will only give me max. 500 datasets as a JSON, so i should pass the id of the&amp;nbsp;last row for the next call. (it will then give me the rows starting with the next id after the provided one).&lt;/P&gt; 
&lt;P&gt;At the end i want to add all received rows to a mysql table.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;What i have so far:&lt;/P&gt; 
&lt;P&gt;JSON:&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tos_json" style="width: 468px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M1Jw.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/147842i63FA6B8DC47030D1/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M1Jw.jpg" alt="0683p000009M1Jw.jpg" /&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;Design:&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tos_design" style="width: 964px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M1Qc.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/147405i5883DBCDD32A4540/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M1Qc.jpg" alt="0683p000009M1Qc.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;tJava_1: i set the start_date and end_date parameters to the todays date via Java code, resulting in e.g. "2018-12-10" for this day. I also want to set two values&amp;nbsp; id and continueLoop. The id variable to be set to the last received id to be used with the next call (loop).&lt;/P&gt; 
&lt;PRE&gt;globalMap.put("start_date",currentDate);
globalMap.put("end_date",currentDate);
globalMap.put("id","0");
globalMap.put("continueLoop",true);&lt;/PRE&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;tRESTClient1: The API Call with the three query parameters&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tos_rest_client" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M1Qh.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/132515i8D96AC9AF238916E/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M1Qh.jpg" alt="0683p000009M1Qh.jpg" /&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;tExtractJsonFields: To map the results (see screenshot). Im unsure if the count value can be received this way (a level outside the given "Loop Jsonpath query")&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="toc_extrac_json" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M1Qm.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/150348i1661896683C7909B/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M1Qm.jpg" alt="0683p000009M1Qm.jpg" /&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;tJavaFlex_1:&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;This is where i'm currently lost. The plan was to store the id of the last received dataset for a possible next call and to set the "continueLoop" variable to false if the count value is unequal to 500.&lt;/P&gt; 
&lt;P&gt;Main Code:&lt;/P&gt; 
&lt;PRE&gt;// here is the main part of the component,
// a piece of code executed in the row
// loop
globalMap.put("id",row3.id);
System.out.println(row3.count);
System.out.println(row3.id);&lt;/PRE&gt; 
&lt;P&gt;End Code:&lt;/P&gt; 
&lt;PRE&gt;// end of the component, outside/closing the loop
 System.out.println("Last Row"+ row3.id);
 if(!row3.count.equals("500")) globalMap.put("continueLoop",false);&lt;/PRE&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Currently i receive the error shown in the corresponding screenshot.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="toc_error" style="width: 873px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M1KL.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/143272i02D9C45C2E13BFC8/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M1KL.jpg" alt="0683p000009M1KL.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I appreciate any help&amp;nbsp;from you guys; Thanks in advance for your time!&lt;/P&gt;</description>
    <pubDate>Mon, 10 Dec 2018 15:43:14 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-12-10T15:43:14Z</dc:date>
    <item>
      <title>Accessing the extacted JSON Values with java to paginate REST call/end Loop</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Accessing-the-extacted-JSON-Values-with-java-to-paginate-REST/m-p/2222716#M16192</link>
      <description>&lt;P&gt;Hi There,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;my first real day with Talend Opern Studio, so please be patient with me &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;The Task:&lt;/P&gt; 
&lt;P&gt;Call a REST API with three parameters: starte_date and end_date (current_date) as well as an id for requesting the next rows if there are more than 500. The API will only give me max. 500 datasets as a JSON, so i should pass the id of the&amp;nbsp;last row for the next call. (it will then give me the rows starting with the next id after the provided one).&lt;/P&gt; 
&lt;P&gt;At the end i want to add all received rows to a mysql table.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;What i have so far:&lt;/P&gt; 
&lt;P&gt;JSON:&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tos_json" style="width: 468px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M1Jw.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/147842i63FA6B8DC47030D1/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M1Jw.jpg" alt="0683p000009M1Jw.jpg" /&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;Design:&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tos_design" style="width: 964px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M1Qc.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/147405i5883DBCDD32A4540/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M1Qc.jpg" alt="0683p000009M1Qc.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;tJava_1: i set the start_date and end_date parameters to the todays date via Java code, resulting in e.g. "2018-12-10" for this day. I also want to set two values&amp;nbsp; id and continueLoop. The id variable to be set to the last received id to be used with the next call (loop).&lt;/P&gt; 
&lt;PRE&gt;globalMap.put("start_date",currentDate);
globalMap.put("end_date",currentDate);
globalMap.put("id","0");
globalMap.put("continueLoop",true);&lt;/PRE&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;tRESTClient1: The API Call with the three query parameters&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tos_rest_client" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M1Qh.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/132515i8D96AC9AF238916E/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M1Qh.jpg" alt="0683p000009M1Qh.jpg" /&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;tExtractJsonFields: To map the results (see screenshot). Im unsure if the count value can be received this way (a level outside the given "Loop Jsonpath query")&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="toc_extrac_json" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M1Qm.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/150348i1661896683C7909B/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M1Qm.jpg" alt="0683p000009M1Qm.jpg" /&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;tJavaFlex_1:&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;This is where i'm currently lost. The plan was to store the id of the last received dataset for a possible next call and to set the "continueLoop" variable to false if the count value is unequal to 500.&lt;/P&gt; 
&lt;P&gt;Main Code:&lt;/P&gt; 
&lt;PRE&gt;// here is the main part of the component,
// a piece of code executed in the row
// loop
globalMap.put("id",row3.id);
System.out.println(row3.count);
System.out.println(row3.id);&lt;/PRE&gt; 
&lt;P&gt;End Code:&lt;/P&gt; 
&lt;PRE&gt;// end of the component, outside/closing the loop
 System.out.println("Last Row"+ row3.id);
 if(!row3.count.equals("500")) globalMap.put("continueLoop",false);&lt;/PRE&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Currently i receive the error shown in the corresponding screenshot.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="toc_error" style="width: 873px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M1KL.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/143272i02D9C45C2E13BFC8/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M1KL.jpg" alt="0683p000009M1KL.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I appreciate any help&amp;nbsp;from you guys; Thanks in advance for your time!&lt;/P&gt;</description>
      <pubDate>Mon, 10 Dec 2018 15:43:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Accessing-the-extacted-JSON-Values-with-java-to-paginate-REST/m-p/2222716#M16192</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-12-10T15:43:14Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing the extacted JSON Values with java to paginate REST call/end Loop</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Accessing-the-extacted-JSON-Values-with-java-to-paginate-REST/m-p/2222717#M16193</link>
      <description>&lt;P&gt;A short update on this. I managed to solve the error. It was caused by the Mapping of the "count" variable in tExtractJSONFields_1.&lt;/P&gt; 
&lt;P&gt;So i know did manage to receive all the rows within a loop.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Now: How can i get the rows of data into a Database (e.g. MySQL or BigQuery?).&lt;/P&gt; 
&lt;P&gt;Thanks again&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Dec 2018 16:06:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Accessing-the-extacted-JSON-Values-with-java-to-paginate-REST/m-p/2222717#M16193</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-12-10T16:06:00Z</dc:date>
    </item>
  </channel>
</rss>

