<?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: JSON data with a nested structure not loaded properly in Connectivity &amp; Data Prep</title>
    <link>https://community.qlik.com/t5/Connectivity-Data-Prep/JSON-data-with-a-nested-structure-not-loaded-properly/m-p/1910055#M10465</link>
    <description>&lt;P&gt;Did you get this working?&lt;/P&gt;</description>
    <pubDate>Fri, 25 Mar 2022 20:52:59 GMT</pubDate>
    <dc:creator>DaveC1</dc:creator>
    <dc:date>2022-03-25T20:52:59Z</dc:date>
    <item>
      <title>JSON data with a nested structure not loaded properly</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/JSON-data-with-a-nested-structure-not-loaded-properly/m-p/1731383#M5297</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I'm trying to load data from an API into Qlik Sense. The API returns data in a nested JSON format, similar to the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;{
   "0": [
      {
         first_field: &amp;lt;value&amp;gt;,
         second_field: &amp;lt;value&amp;gt;,
         subfields: {
            first_subfield: &amp;lt;value&amp;gt;,
            second_subfield: &amp;lt;value&amp;gt;
         }
      },
      ...
   ]
}&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;The generated code from the REST connection is similar to the following:&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;LIB CONNECT TO '&amp;lt;MY_REST_CONNECTION_LIB&amp;gt;';
RestConnectorMasterTable:
SQL SELECT 
	"__KEY_root",
	(SELECT 
		"first_field",
		"second_field",
		"__KEY_0",
		"__FK_0",
		(SELECT 
			"first_subfield",
			"second_subfield",
			"__FK_subfields"
		FROM "subfields" FK "__FK_subfields")
	FROM "0" PK "__KEY_0" FK "__FK_0")
FROM JSON (wrap on) "root" PK "__KEY_root"
WITH CONNECTION(URL "&amp;lt;API&amp;gt;");&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;However, that data is not loaded correctly. The &amp;lt;first_subfield&amp;gt; can have different values for the same &amp;lt;first_field&amp;gt; value. That is, there are the same &amp;lt;first_field&amp;gt; and &amp;lt;second_field&amp;gt; values that occur with different &amp;lt;first_subfield&amp;gt; values.&amp;nbsp; However, in Qlik Sense, for each unique value of &amp;lt;first_field&amp;gt; there is only the first value of &amp;lt;first_subfield&amp;gt; loaded. Some of the rows are missing.&lt;/P&gt;&lt;P&gt;Does someone know where the problem could be?&lt;/P&gt;&lt;P&gt;Thank you in advance!&lt;/P&gt;</description>
      <pubDate>Thu, 23 Dec 2021 13:16:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/JSON-data-with-a-nested-structure-not-loaded-properly/m-p/1731383#M5297</guid>
      <dc:creator>limu</dc:creator>
      <dc:date>2021-12-23T13:16:11Z</dc:date>
    </item>
    <item>
      <title>Re: JSON data with a nested structure not loaded properly</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/JSON-data-with-a-nested-structure-not-loaded-properly/m-p/1910055#M10465</link>
      <description>&lt;P&gt;Did you get this working?&lt;/P&gt;</description>
      <pubDate>Fri, 25 Mar 2022 20:52:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/JSON-data-with-a-nested-structure-not-loaded-properly/m-p/1910055#M10465</guid>
      <dc:creator>DaveC1</dc:creator>
      <dc:date>2022-03-25T20:52:59Z</dc:date>
    </item>
  </channel>
</rss>

