<?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 Extracting Data from a JSON with pagination to an excel in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Extracting-Data-from-a-JSON-with-pagination-to-an-excel/m-p/2264290#M44174</link>
    <description>&lt;P&gt;I have extracted data from an API with pagination. I have attached screenshots for all my components and I'm getting an output for every page in the API. I need to extract these information into an excel but the output will not be coming as a tabular format (see the output figure).&lt;/P&gt; 
&lt;P&gt;The issue why my data comes in one row is&amp;nbsp;my data is under "$.task_assignments.[*]" and the next page url is in "$.links.[*]" path of JSON (see the attached JSON image).&lt;/P&gt; 
&lt;P&gt;If I define the Loop Jsonpath query as&amp;nbsp;"$.task_assignments.[*]" and extract data I can get my data in a tabular format but I can't get the URL and If I define the&amp;nbsp;Loop Jsonpath query as&amp;nbsp;"$.links.[*]" then I can get the URL and in that case I don't get the data.&lt;/P&gt; 
&lt;P&gt;So as a solution I set up the&amp;nbsp;&amp;nbsp;Loop Jsonpath query as&amp;nbsp;"$" which is a common path but in that case although the data comes it doesn't comes in a tabular format.&lt;/P&gt; 
&lt;P&gt;I hope you can understand what I'm asking. So it would be great if someone can help in extracting these data into one table and export into excel&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="Figure 1.PNG" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M4er.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/129023i49A774C6E3936734/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M4er.png" alt="0683p000009M4er.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Figure 3.PNG" style="width: 769px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M4ew.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/146442iEB6F5E32B147D1FA/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M4ew.png" alt="0683p000009M4ew.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 17 Apr 2019 11:48:39 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-04-17T11:48:39Z</dc:date>
    <item>
      <title>Extracting Data from a JSON with pagination to an excel</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Extracting-Data-from-a-JSON-with-pagination-to-an-excel/m-p/2264290#M44174</link>
      <description>&lt;P&gt;I have extracted data from an API with pagination. I have attached screenshots for all my components and I'm getting an output for every page in the API. I need to extract these information into an excel but the output will not be coming as a tabular format (see the output figure).&lt;/P&gt; 
&lt;P&gt;The issue why my data comes in one row is&amp;nbsp;my data is under "$.task_assignments.[*]" and the next page url is in "$.links.[*]" path of JSON (see the attached JSON image).&lt;/P&gt; 
&lt;P&gt;If I define the Loop Jsonpath query as&amp;nbsp;"$.task_assignments.[*]" and extract data I can get my data in a tabular format but I can't get the URL and If I define the&amp;nbsp;Loop Jsonpath query as&amp;nbsp;"$.links.[*]" then I can get the URL and in that case I don't get the data.&lt;/P&gt; 
&lt;P&gt;So as a solution I set up the&amp;nbsp;&amp;nbsp;Loop Jsonpath query as&amp;nbsp;"$" which is a common path but in that case although the data comes it doesn't comes in a tabular format.&lt;/P&gt; 
&lt;P&gt;I hope you can understand what I'm asking. So it would be great if someone can help in extracting these data into one table and export into excel&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="Figure 1.PNG" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M4er.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/129023i49A774C6E3936734/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M4er.png" alt="0683p000009M4er.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Figure 3.PNG" style="width: 769px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M4ew.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/146442iEB6F5E32B147D1FA/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M4ew.png" alt="0683p000009M4ew.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Apr 2019 11:48:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Extracting-Data-from-a-JSON-with-pagination-to-an-excel/m-p/2264290#M44174</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-04-17T11:48:39Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting Data from a JSON with pagination to an excel</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Extracting-Data-from-a-JSON-with-pagination-to-an-excel/m-p/2264291#M44175</link>
      <description>&lt;P&gt;Why not build urls custom? No need to read the json each time to get the next url.&lt;/P&gt;&lt;P&gt;You can do an initial call to the api and extract&amp;nbsp;&lt;EM&gt;total_pages,&lt;/EM&gt; put that in a tLoop from 1 to&amp;nbsp;&lt;EM&gt;total_pages,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;then just append ((Integer)globalMap.get("tLoop_1_CURRENT_VALUE")) to your tRestClient query string&lt;/P&gt;&lt;P&gt;so it looks something like this:&amp;nbsp;&lt;/P&gt;&lt;P&gt;"&lt;A href="https://api.harvestapp.com/v2/task_assignments_page=&amp;quot;+" target="_blank" rel="nofollow noopener noreferrer"&gt;https://api.harvestapp.com/v2/task_assignments_page="+&lt;/A&gt; ((Integer)globalMap.get("tLoop_1_CURRENT_VALUE")) +"&amp;amp;per_page=100"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This way your jsonpath from tExtractJSONFields wont have to change, and you'll get only the relevant data you need.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Apr 2019 18:37:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Extracting-Data-from-a-JSON-with-pagination-to-an-excel/m-p/2264291#M44175</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-04-17T18:37:22Z</dc:date>
    </item>
  </channel>
</rss>

