<?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 restructure a nested JSON response from REST Connector? in Integration, Extension &amp; APIs</title>
    <link>https://community.qlik.com/t5/Integration-Extension-APIs/How-to-restructure-a-nested-JSON-response-from-REST-Connector/m-p/1773923#M13699</link>
    <description>&lt;P&gt;&lt;SPAN&gt;Hello, did you managed to load nested JSON and structure this into table? Thanks a lot for your help!&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 13 Jan 2021 07:12:05 GMT</pubDate>
    <dc:creator>RybaSlodkowodna</dc:creator>
    <dc:date>2021-01-13T07:12:05Z</dc:date>
    <item>
      <title>How to restructure a nested JSON response from REST Connector?</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/How-to-restructure-a-nested-JSON-response-from-REST-Connector/m-p/1702076#M12777</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am&amp;nbsp;&lt;SPAN&gt;using Qlik REST connector to load data from an API that returns JSON. However, since each row in the data has a key (see image below), the REST Connector is&amp;nbsp; creating a separate table for each row.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="02.jpg" style="width: 416px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/33636iD350AEAAF1DADCF8/image-size/large?v=v2&amp;amp;px=999" role="button" title="02.jpg" alt="02.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The code generated is as follows:&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;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;SQL SELECT
	"__KEY_root",
	(SELECT 
		"a_field_1",
		"__FK_first_key"
	FROM "first_key" FK "__FK_first_key"),
	(SELECT 
		"__KEY_0",
		"__FK_0",
		(SELECT 
			"another_field",
			"__FK_another_key"
		FROM "another_key" FK "__FK_another_key"),
		(SELECT 
			"my_data_is_here"
			"__FK_0_u0"
		FROM "0" FK "__FK_0_u0"),
		(SELECT 
			"my_data_is_here" AS "my_data_is_here_u0",
			"__FK_1"
		FROM "1" FK "__FK_1"),
		(SELECT 
			"my_data_is_here" AS "my_data_is_here_u1",
			"__FK_2"
                 ...
         FROM "0" PK "__KEY_0" FK "__FK_0")
FROM JSON (wrap on) "root" PK "__KEY_root";&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Is there a way to count the number of rows, so that I could somehow loop through each of the tables and concatenate them into one?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thank you in advance!&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Aug 2021 18:39:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/How-to-restructure-a-nested-JSON-response-from-REST-Connector/m-p/1702076#M12777</guid>
      <dc:creator>limu</dc:creator>
      <dc:date>2021-08-13T18:39:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to restructure a nested JSON response from REST Connector?</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/How-to-restructure-a-nested-JSON-response-from-REST-Connector/m-p/1702890#M12781</link>
      <description>&lt;P&gt;This is going to require a fair bit of scripting*, but is possible insofar as you have a listing of the top level elements (0, 1, 2, etc). We're doing a similar method in the &lt;A href="https://github.com/eapowertools/qs-extension-usage-dashboard" target="_self"&gt;Extension Usage Dashboard&lt;/A&gt;. If you download the app and go to the script section named&amp;nbsp;&lt;STRONG&gt;Extension Schema from QRS&lt;/STRONG&gt; you'll see us dynamically building out the load script based on the prior call to get a list of extensions (&lt;STRONG&gt;Extensions data from QRS&lt;/STRONG&gt;). The gist of it is that you are dynamically building the top level element to construct a load script then calling that load script and repeating the process as needed.&lt;/P&gt;&lt;P&gt;* It'd be a similar problem if your relational database also changed the column / table names.&lt;/P&gt;</description>
      <pubDate>Sun, 17 May 2020 17:51:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/How-to-restructure-a-nested-JSON-response-from-REST-Connector/m-p/1702890#M12781</guid>
      <dc:creator>Levi_Turner</dc:creator>
      <dc:date>2020-05-17T17:51:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to restructure a nested JSON response from REST Connector?</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/How-to-restructure-a-nested-JSON-response-from-REST-Connector/m-p/1773923#M13699</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hello, did you managed to load nested JSON and structure this into table? Thanks a lot for your help!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jan 2021 07:12:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/How-to-restructure-a-nested-JSON-response-from-REST-Connector/m-p/1773923#M13699</guid>
      <dc:creator>RybaSlodkowodna</dc:creator>
      <dc:date>2021-01-13T07:12:05Z</dc:date>
    </item>
  </channel>
</rss>

