<?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 Optional SQL Select with REST Data Connection in Connectivity &amp; Data Prep</title>
    <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Optional-SQL-Select-with-REST-Data-Connection/m-p/1559136#M3745</link>
    <description>&lt;P&gt;Hey there,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;so I am developing some Dashboards for a many customers.&lt;/P&gt;&lt;P&gt;I know the maximum or all possible fields. So it's a REST Connection, and they get a Response with just the fields that are existing.&lt;/P&gt;&lt;P&gt;My Question now:&lt;BR /&gt;How can I develop the Script so, that if there ist every possible field in the REST Response, everythings fine, and if there are a lot of fields missing, how will the script still continue to work?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
    <pubDate>Wed, 22 Dec 2021 14:44:26 GMT</pubDate>
    <dc:creator>joshuahirsch</dc:creator>
    <dc:date>2021-12-22T14:44:26Z</dc:date>
    <item>
      <title>Optional SQL Select with REST Data Connection</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Optional-SQL-Select-with-REST-Data-Connection/m-p/1559136#M3745</link>
      <description>&lt;P&gt;Hey there,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;so I am developing some Dashboards for a many customers.&lt;/P&gt;&lt;P&gt;I know the maximum or all possible fields. So it's a REST Connection, and they get a Response with just the fields that are existing.&lt;/P&gt;&lt;P&gt;My Question now:&lt;BR /&gt;How can I develop the Script so, that if there ist every possible field in the REST Response, everythings fine, and if there are a lot of fields missing, how will the script still continue to work?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Wed, 22 Dec 2021 14:44:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Optional-SQL-Select-with-REST-Data-Connection/m-p/1559136#M3745</guid>
      <dc:creator>joshuahirsch</dc:creator>
      <dc:date>2021-12-22T14:44:26Z</dc:date>
    </item>
    <item>
      <title>Re: Optional SQL Select with REST Data Connection</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Optional-SQL-Select-with-REST-Data-Connection/m-p/1560862#M3750</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SQL statement of REST connector does not throw any error if a filed does not exist in the query. It simply skips non-existing fields.&lt;/P&gt;
&lt;P&gt;The auto-generated LOAD statement following the SQL query (if&amp;nbsp; you create query from the Select Data wizard) however, may throw errors if the field does not exist. You can overcome this by replacing &lt;FONT face="courier new,courier"&gt;LOAD [fieldNames]&lt;/FONT&gt; with &lt;FONT face="courier new,courier"&gt;LOAD *&lt;/FONT&gt; . Or simply remove the LOAD statement.&lt;/P&gt;
&lt;P&gt;For example, the following piece of script loads data from&amp;nbsp;&lt;A href="https://jsonplaceholder.typicode.com/posts" target="_blank"&gt;https://jsonplaceholder.typicode.com/posts&lt;/A&gt;, including field&amp;nbsp;"nonexisting" that is not in the API source.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;LIB CONNECT TO 'testJSON';

RestConnectorMasterTable:
SQL SELECT 
	"userId",
	"id",
	"title",
	"body",
        &lt;STRONG&gt;"nonexisting" &lt;/STRONG&gt;&lt;FONT color="#999999"&gt;//this field does not exist in the source&lt;/FONT&gt;
FROM JSON (wrap on) "root";

[root]:
NoConcatenate LOAD	*
RESIDENT RestConnectorMasterTable;&lt;BR /&gt;&lt;BR /&gt;DROP TABLE RestConnectorMasterTable;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Mar 2019 15:37:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Optional-SQL-Select-with-REST-Data-Connection/m-p/1560862#M3750</guid>
      <dc:creator>Vu_Nguyen</dc:creator>
      <dc:date>2019-03-25T15:37:44Z</dc:date>
    </item>
  </channel>
</rss>

