<?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 Rest Connector Duplication Error with Auto-Generated keys in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Rest-Connector-Duplication-Error-with-Auto-Generated-keys/m-p/2462335#M99201</link>
    <description>&lt;P&gt;I am using a REST connector to pull data from an API.&lt;/P&gt;
&lt;P&gt;For most nested objects, it creates a __KEY_x value and a __FK_x value, where the FK matches the KEY of the parent object.&lt;/P&gt;
&lt;P&gt;This works for all but one nested object where the __KEY_ values are unique. However, I have one nested object where it generates the same value for every parent, making the one object useless.&lt;/P&gt;
&lt;P&gt;ie:&lt;/P&gt;
&lt;P&gt;Order 1 key = ABC, Nested object FK = ABC and KEY = XYZ&lt;/P&gt;
&lt;P&gt;Order 2 key = BCD, Nested object FK = BCD and KEY = XYZ ( used again, but should be different )&lt;/P&gt;
&lt;P&gt;Order 3 key = CDE, Nested object FK = CDE and KEY = XYZ ( used again, but should be different )&lt;/P&gt;
&lt;P&gt;etc...&lt;/P&gt;
&lt;P&gt;I created a new connector to the same API and am still getting the same results. For all other nested objects this works fine! I don't see how I can control this any better or how I can force it to start behaving properly. Please let me know if this has been seen and resolved before! Thank you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Code:&lt;/P&gt;
&lt;P&gt;RestConnectorMasterTable:&lt;BR /&gt;SQL SELECT &lt;BR /&gt;&amp;nbsp; &amp;nbsp;"cursor",&lt;BR /&gt;&amp;nbsp; &amp;nbsp;"__KEY_root",&lt;BR /&gt;&amp;nbsp; &amp;nbsp;(SELECT &lt;BR /&gt;&amp;nbsp; &amp;nbsp;"id",&lt;BR /&gt;&amp;nbsp; &amp;nbsp;"__KEY_orders",&lt;BR /&gt;&amp;nbsp; &amp;nbsp;"__FK_orders",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; (SELECT &lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;STRONG&gt; "__KEY_additionalInfo",&lt;/STRONG&gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; "__FK_additionalInfo"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; FROM "additionalInfo" PK "__KEY_additionalInfo" FK "__FK_additionalInfo")&lt;BR /&gt;&amp;nbsp; &amp;nbsp;FROM "orders" PK "__KEY_orders" FK "__FK_orders")&lt;BR /&gt;FROM JSON (wrap on) "root" PK "__KEY_root"&lt;/P&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;P&gt;The __KEY_addtionalInfo is what is consistently showing duplicates.&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 16:36:28 GMT</pubDate>
    <dc:creator>bobiloco</dc:creator>
    <dc:date>2024-11-16T16:36:28Z</dc:date>
    <item>
      <title>Rest Connector Duplication Error with Auto-Generated keys</title>
      <link>https://community.qlik.com/t5/App-Development/Rest-Connector-Duplication-Error-with-Auto-Generated-keys/m-p/2462335#M99201</link>
      <description>&lt;P&gt;I am using a REST connector to pull data from an API.&lt;/P&gt;
&lt;P&gt;For most nested objects, it creates a __KEY_x value and a __FK_x value, where the FK matches the KEY of the parent object.&lt;/P&gt;
&lt;P&gt;This works for all but one nested object where the __KEY_ values are unique. However, I have one nested object where it generates the same value for every parent, making the one object useless.&lt;/P&gt;
&lt;P&gt;ie:&lt;/P&gt;
&lt;P&gt;Order 1 key = ABC, Nested object FK = ABC and KEY = XYZ&lt;/P&gt;
&lt;P&gt;Order 2 key = BCD, Nested object FK = BCD and KEY = XYZ ( used again, but should be different )&lt;/P&gt;
&lt;P&gt;Order 3 key = CDE, Nested object FK = CDE and KEY = XYZ ( used again, but should be different )&lt;/P&gt;
&lt;P&gt;etc...&lt;/P&gt;
&lt;P&gt;I created a new connector to the same API and am still getting the same results. For all other nested objects this works fine! I don't see how I can control this any better or how I can force it to start behaving properly. Please let me know if this has been seen and resolved before! Thank you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Code:&lt;/P&gt;
&lt;P&gt;RestConnectorMasterTable:&lt;BR /&gt;SQL SELECT &lt;BR /&gt;&amp;nbsp; &amp;nbsp;"cursor",&lt;BR /&gt;&amp;nbsp; &amp;nbsp;"__KEY_root",&lt;BR /&gt;&amp;nbsp; &amp;nbsp;(SELECT &lt;BR /&gt;&amp;nbsp; &amp;nbsp;"id",&lt;BR /&gt;&amp;nbsp; &amp;nbsp;"__KEY_orders",&lt;BR /&gt;&amp;nbsp; &amp;nbsp;"__FK_orders",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; (SELECT &lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;STRONG&gt; "__KEY_additionalInfo",&lt;/STRONG&gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; "__FK_additionalInfo"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; FROM "additionalInfo" PK "__KEY_additionalInfo" FK "__FK_additionalInfo")&lt;BR /&gt;&amp;nbsp; &amp;nbsp;FROM "orders" PK "__KEY_orders" FK "__FK_orders")&lt;BR /&gt;FROM JSON (wrap on) "root" PK "__KEY_root"&lt;/P&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;P&gt;The __KEY_addtionalInfo is what is consistently showing duplicates.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 16:36:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Rest-Connector-Duplication-Error-with-Auto-Generated-keys/m-p/2462335#M99201</guid>
      <dc:creator>bobiloco</dc:creator>
      <dc:date>2024-11-16T16:36:28Z</dc:date>
    </item>
    <item>
      <title>Re: Rest Connector Duplication Error with Auto-Generated keys</title>
      <link>https://community.qlik.com/t5/App-Development/Rest-Connector-Duplication-Error-with-Auto-Generated-keys/m-p/2462388#M99202</link>
      <description>&lt;P&gt;You can modify the SQL statement to introduce some uniqueness. For example:&lt;/P&gt;
&lt;PRE&gt;Concat(&amp;nbsp;"__KEY_orders",&amp;nbsp;'-',&amp;nbsp;"__KEY_additionalInfo") as&amp;nbsp;"__KEY_additionalInfo",&lt;/PRE&gt;
&lt;P&gt;-Rob&lt;BR /&gt;&lt;A href="http://www.easyqlik.com" target="_blank"&gt;http://www.easyqlik.com&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://masterssummit.com" target="_blank"&gt;http://masterssummit.com&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://qlikviewcookbook.com" target="_blank"&gt;http://qlikviewcookbook.com&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jun 2024 00:53:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Rest-Connector-Duplication-Error-with-Auto-Generated-keys/m-p/2462388#M99202</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2024-06-14T00:53:12Z</dc:date>
    </item>
    <item>
      <title>Re: Rest Connector Duplication Error with Auto-Generated keys</title>
      <link>https://community.qlik.com/t5/App-Development/Rest-Connector-Duplication-Error-with-Auto-Generated-keys/m-p/2462654#M99204</link>
      <description>&lt;P&gt;Thank you for taking a stab at this!&lt;/P&gt;
&lt;P&gt;Unfortunately, the point of making this unique is for the nested objects to be able to join back to the parent's key, and the nested objects don't have the __KEY field required to do this, only the FK. I tried adding the KEY field names to the SQL statement but they show up as nulls.&lt;/P&gt;
&lt;P&gt;In this example below, all of the __KEY_additionalInfo and __FK_shipCompliant values are exactly the same for every record:&lt;/P&gt;
&lt;P&gt;(SELECT &lt;BR /&gt;"__KEY_additionalInfo",&lt;BR /&gt;"__FK_additionalInfo",&lt;BR /&gt;&amp;nbsp; (SELECT &lt;BR /&gt;&amp;nbsp; "__FK_shipCompliant",&lt;BR /&gt;&amp;nbsp; "shipmentStatus"&lt;BR /&gt;&amp;nbsp; FROM "shipCompliant" FK "__FK_shipCompliant"),&lt;/P&gt;
&lt;P&gt;I'll go through our partner to try to raise a ticket for this. I can't see how this is expected behaviour.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jun 2024 15:11:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Rest-Connector-Duplication-Error-with-Auto-Generated-keys/m-p/2462654#M99204</guid>
      <dc:creator>bobiloco</dc:creator>
      <dc:date>2024-06-14T15:11:41Z</dc:date>
    </item>
  </channel>
</rss>

