<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Reporting - Tableau Archives | ZappySys Blog</title>
	<atom:link href="https://zappysys.com/blog/category/odbc-powerpack/odbc-app-integration/bi-reporting-tableau/feed/" rel="self" type="application/rss+xml" />
	<link>https://zappysys.com/blog/category/odbc-powerpack/odbc-app-integration/bi-reporting-tableau/</link>
	<description>SSIS / ODBC Drivers / API Connectors for JSON, XML, Azure, Amazon AWS, Salesforce, MongoDB and more</description>
	<lastBuildDate>Tue, 23 Dec 2025 13:01:44 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.4.4</generator>

<image>
	<url>https://zappysys.com/blog/wp-content/uploads/2023/01/cropped-zappysys-symbol-large-32x32.png</url>
	<title>Reporting - Tableau Archives | ZappySys Blog</title>
	<link>https://zappysys.com/blog/category/odbc-powerpack/odbc-app-integration/bi-reporting-tableau/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Tableau Parameters &#8211; Fix Metadata / Dynamic SQL Columns Issue</title>
		<link>https://zappysys.com/blog/create-csv-list-sql-server-table-columns-datatypes/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Mon, 05 Nov 2018 17:17:42 +0000</pubDate>
				<category><![CDATA[Reporting - Tableau]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=5304</guid>

					<description><![CDATA[<p>Introduction Many time you have to use Dynamic SQL in your Stored Procedure but some tools (e.g. Tableau) may reject it because metadata is not returned when sp_describe_first_result_set is called in SQL Prepare phase. You may see error like below in that case. &#160; &#160; Metadata Prepare Call [crayon-69d8ad1228938956233568/] Error due to Dynamic SQL Msg [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/create-csv-list-sql-server-table-columns-datatypes/">Tableau Parameters &#8211; Fix Metadata / Dynamic SQL Columns Issue</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction</h2>
<p><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/tableau-integration-logo.png"><img decoding="async" class=" wp-image-4374 alignleft" src="https://zappysys.com/blog/wp-content/uploads/2018/06/tableau-integration-logo.png" alt="" width="97" height="97" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/tableau-integration-logo.png 376w, https://zappysys.com/blog/wp-content/uploads/2018/06/tableau-integration-logo-150x150.png 150w, https://zappysys.com/blog/wp-content/uploads/2018/06/tableau-integration-logo-300x300.png 300w" sizes="(max-width: 97px) 100vw, 97px" /></a>Many time you have to use Dynamic SQL in your Stored Procedure but some tools (e.g. <a href="https://zappysys.com/blog/tag/tableau/" target="_blank" rel="noopener">Tableau</a>) may reject it because metadata is not returned when sp_describe_first_result_set is called in SQL Prepare phase. You may see error like below in that case.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><strong>Metadata Prepare Call</strong></p><pre class="crayon-plain-tag">exec sp_describe_first_result_set N'EXEC [dbo].[usp_GetInvoicesByCountry] @country=''Germany'''</pre><p>
<strong>Error due to Dynamic SQL</strong></p>
<p><span style="color: #ff0000;"><code>Msg 11514, Level 16, State 1, Procedure sp_describe_first_result_set, Line 1 [Batch Start Line 29]</code></span><br />
<code><span style="color: #ff0000;">The metadata could not be determined because statement 'EXECUTE (@sqlFull)' in procedure 'usp_GetInvoicesByCountry' contains dynamic SQL. Consider using the WITH RESULT SETS clause to explicitly describe the result set.</span></code></p>
<p>Here is example Stored Procedure which may throw above error. We will re-write same stored proc in later section.</p>
<h2><strong>Example of Dynamic SQL in Stored Procedure</strong></h2>
<pre class="crayon-plain-tag">--DROP PROC dbo.usp_GetInvoicesByCountry
--GO
/*
Purpose: Parameterize REST API call via SQL. Call ZappySys Drivers inside SQL Server.
*/
CREATE PROC dbo.usp_GetInvoicesByCountry
	@country varchar(100) 
AS 

DECLARE @sql varchar(max)
--//Escape single ticks carefully
SET @sql =  'SELECT OrderID,CustomerID,Country,Quantity FROM $
WITH (Src=''https://services.odata.org/V3/Northwind/Northwind.svc/Invoices?$format=json&amp;filter=Country eq '+ @country +'''
	 ,Filter=''$.value[*]''
	 ,DataFormat=''OData''
)'

DECLARE @sqlFull varchar(max)
SET @sqlFull='SELECT * FROM OPENQUERY( LS , ''' + REPLACE( @sql, '''', '''''' ) + ''' )'
PRINT @sqlFull --//For DEBUG purpose
EXECUTE (@sqlFull)

GO
-- Example call
EXEC dbo.usp_GetInvoicesByCountry @country='Germany'</pre>
&nbsp;</p>
<h2><strong>How to Fix Metadata error for Dynamic SQL</strong></h2>
<p>To fix metadata error due to dynamic SQL you have add <a href="https://docs.microsoft.com/en-us/sql/t-sql/language-elements/execute-transact-sql?view=sql-server-2017" target="_blank" rel="noopener">WITH RESULT SETS</a> statement after EXECUTE call. This feature was added in SQL 2012 and later. There are two ways to describe Stored Procedure / using Dynamic SQL</p>
<h3>Method-1</h3>
<p>Add  <a href="https://docs.microsoft.com/en-us/sql/t-sql/language-elements/execute-transact-sql?view=sql-server-2017" target="_blank" rel="noopener">WITH RESULT SETS</a> clause inside Stored Proc if you are using EXECUTE or sp_Executesql like below.</p><pre class="crayon-plain-tag">--DROP PROC dbo.usp_GetInvoicesByCountry
--GO
/*
Purpose: Parameterize REST API call via SQL. Call ZappySys Drivers inside SQL Server.
*/
ALTER PROC dbo.usp_GetInvoicesByCountry
	@country varchar(100) 
AS 

DECLARE @sql varchar(max)
--//Escape single ticks carefully
SET @sql =  'SELECT OrderID,CustomerID,Country,Quantity FROM $
WITH (Src=''https://services.odata.org/V3/Northwind/Northwind.svc/Invoices?$format=json&amp;filter=Country eq '+ @country +'''
	 ,Filter=''$.value[*]''
	 ,DataFormat=''OData''
)'

DECLARE @sqlFull varchar(max)
SET @sqlFull='SELECT * FROM OPENQUERY( LS , ''' + REPLACE( @sql, '''', '''''' ) + ''' )'
PRINT @sqlFull --//For DEBUG purpose

EXECUTE (@sqlFull)
WITH RESULT SETS
(
	(OrderID int,CustomerID varchar(100),Country varchar(100),Quantity int) --//describe first result
)
GO</pre><p>
&nbsp;</p>
<h3>Method-2</h3>
<p>Another way to describe resultset is add WITH RESULT SETS statement right after you call Stored proc each time from any client tool (see below). This way you don&#8217;t have to touch Source stored Proc. First method is still preferred way.</p><pre class="crayon-plain-tag">EXEC [dbo].[usp_GetInvoicesByCountry] @country='Germany' WITH RESULT SETS ( (OrderID int,CustomerID varchar(100),Country varchar(100),Quantity int))</pre><p>
<h2>How to generate column names and field datatypes for WITH RESULT SETS</h2>
<p>If you have many columns to describe then it becomes tedious to type 200 columns by hand. Lets see how to make it simple.</p>
<ol>
<li>First step is you need to load your result into some static table.<br />
<pre class="crayon-plain-tag">SELECT * INTO _tmp FROM ( some sub query ) t</pre>
</li>
<li>Once you have data we can use it few ways to get datatypes. Lets create a view to query metadata<br />
<pre class="crayon-plain-tag">CREATE VIEW dbo.vwDataTypes
AS
SELECT 
   c.name as ColumnName,
   t.name +
   CASE WHEN t.name IN ('char', 'varchar','nchar','nvarchar') THEN '('+
             CASE WHEN c.max_length=-1 THEN 'MAX'
                  ELSE CONVERT(VARCHAR(4),
                               CASE WHEN t.name IN ('nchar','nvarchar')
                               THEN  c.max_length/2 ELSE c.max_length END )
                  END +')'
          WHEN t.name IN ('decimal','numeric')
                  THEN '('+ CONVERT(VARCHAR(4),c.precision)+','
                          + CONVERT(VARCHAR(4),c.Scale)+')'
                  ELSE '' END
	      as FriendlyDataType,
   t.name as DataType,
   c.[object_id] as [TblObjectId],
   c.max_length MaxLengthBytes,
   c.precision as [Precision],
   c.scale  as [Scale],
   c.is_nullable as IsNullable,
   ISNULL(i.is_primary_key, 0) as IsPrimaryKey
FROM    
   sys.columns c
INNER JOIN 
   sys.types t ON c.user_type_id = t.user_type_id
LEFT OUTER JOIN 
   sys.index_columns ic ON ic.object_id = c.object_id AND ic.column_id = c.column_id
LEFT OUTER JOIN 
   sys.indexes i ON ic.object_id = i.object_id AND ic.index_id = i.index_id
--WHERE    c.object_id = OBJECT_ID('_tmp')
go</pre>
</li>
<li>Now you can write below query to generate Comma separated list of columns names and datatypes<br />
<pre class="crayon-plain-tag">DECLARE @csv VARCHAR(MAX)
SELECT @csv = COALESCE(@csv+', ' ,'') + '[' + ColumnName + '] ' + FriendlyDataType
FROM vwDataTypes WHERE [TblObjectId]= OBJECT_ID('_tmp')
SELECT @csv</pre>
<strong>Example : </strong><br />
<pre class="crayon-plain-tag">[CustomerID] nvarchar(10), [CustomerName] nvarchar(68), .........&nbsp;[Freight] nvarchar(16)</pre>
</li>
<li>Use result of above query and paste in WITH RESULT SETS as below<br />
<pre class="crayon-plain-tag">EXECUTE( @sqlFull )
WITH RESULT SETS
(
&nbsp; (&nbsp; your-comma-separated-list-goes-here )
)</pre>
</li>
</ol>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>The post <a href="https://zappysys.com/blog/create-csv-list-sql-server-table-columns-datatypes/">Tableau Parameters &#8211; Fix Metadata / Dynamic SQL Columns Issue</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Import REST API in Tableau &#8211; Read JSON, SOAP XML, CSV</title>
		<link>https://zappysys.com/blog/import-rest-api-tableau-read-json-soap-xml-csv/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Sun, 04 Nov 2018 22:52:06 +0000</pubDate>
				<category><![CDATA[JSON File / REST API Driver]]></category>
		<category><![CDATA[ODBC Gateway]]></category>
		<category><![CDATA[Reporting - Tableau]]></category>
		<category><![CDATA[REST API]]></category>
		<category><![CDATA[REST API Integration]]></category>
		<category><![CDATA[XML File / SOAP API Driver]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[odbc]]></category>
		<category><![CDATA[rest api]]></category>
		<category><![CDATA[tableau]]></category>
		<category><![CDATA[xml]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=5277</guid>

					<description><![CDATA[<p>Introduction Tableau is one of the most popular Reporting / Visualization tool for BI / Data analytics. It comes with many out-of the box connectors to pull data from some popular data sources but still it seriously lakes capability to consume data from millions of other REST / SOAP data sources out there for which [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/import-rest-api-tableau-read-json-soap-xml-csv/">Import REST API in Tableau &#8211; Read JSON, SOAP XML, CSV</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction</h2>
<p><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/tableau-integration-logo.png"><img loading="lazy" decoding="async" class="wp-image-4374 alignleft" src="https://zappysys.com/blog/wp-content/uploads/2018/06/tableau-integration-logo.png" alt="" width="122" height="122" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/tableau-integration-logo.png 376w, https://zappysys.com/blog/wp-content/uploads/2018/06/tableau-integration-logo-150x150.png 150w, https://zappysys.com/blog/wp-content/uploads/2018/06/tableau-integration-logo-300x300.png 300w" sizes="(max-width: 122px) 100vw, 122px" /></a>Tableau is one of the most popular Reporting / Visualization tool for BI / Data analytics. It comes with many out-of the box connectors to pull data from some popular data sources but still it seriously lakes capability to consume data from millions of other REST / SOAP data sources out there for which Tableau not going to create native connectors.</p>
<p>In this article we will cover how to import REST API in Tableau, We will also look at various examples to read from Files or any JSON / XML SOAP / CSV API in few clicks. We will use <a href="https://zappysys.com/products/odbc-powerpack/" target="_blank" rel="noopener">ZappySys API Drivers</a> to read data from Web API or Local XML / JSON / CSV Files without doing any coding or ETL.</p>
<p>ZappySys API drivers are most advanced API drivers available in the market with many options to connect to virtually any REST / SOAP API data source. For demo purpose we will load ODATA API (JSON Format) using <a href="https://zappysys.com/products/odbc-powerpack/odbc-json-rest-api-driver/" target="_blank" rel="noopener">ZappySys JSON Driver</a>. Concepts / steps listed in this articles are mostly same for other type of API formats too (e.g. XML API or CSV API).</p>
<h2>Requirements</h2>
<p>Before we get started for step by step tutorial, make sure following requirements are met.</p>
<ol>
<li>You have installed Tableau Desktop</li>
<li>Make sure SQL Server Instance is installed somewhere. We will use Linked Server to access REST API. You can <a href="https://www.microsoft.com/en-us/sql-server/sql-server-editions-express" target="_blank" rel="noopener">download FREE SQL Express Version</a> (DB Server) and <a href="https://docs.microsoft.com/en-us/sql/ssms/download-sql-server-management-studio-ssms?view=sql-server-2017" target="_blank" rel="noopener">SSMS from here</a> (Client).</li>
<li>Download and Install <a href="https://zappysys.com/products/odbc-powerpack/" target="_blank" rel="noopener">ZappySys ODBC PowerPack (API Drivers)</a> &#8211; These drivers must be installed on <strong>Windows Machine (Can be different than Tableau Desktop / Server)</strong></li>
</ol>
<h2>Step By Step &#8211; Loading REST API data in Tableau</h2>
<p>Now let&#8217;s get started. To load REST API data in Tableau using ZappySys drivers basically there are two approaches.</p>
<p><strong>Approach#1</strong> You can use direct ODBC Connection to call ZappySys Drivers<br />
<strong>Approach#2</strong> Use SQL Server Connection in Tableau to send ZappySys Driver queries to <a href="https://zappysys.com/products/odbc-powerpack/data-gateway/" target="_blank" rel="noopener">ZappySys Data Gateway</a> (using Linked Server OPENQUERY).</p>
<p><span style="text-decoration: underline;"><span style="color: #339966; text-decoration: underline;">We recommend Approach#2</span></span> for any ZappySys driver use case in Tableau.  Now you must be wondering why use approach#2 and not #1 ? Tableau doesn&#8217;t play well when it comes to 3rd party ODBC drivers because behind the scene Tableau generate complex SQL statements which may not be supported by ODBC driver its trying to call (e.g. JOIN Syntax, CAST functions, Sub queries). See some issues like <a href="https://community.tableau.com/thread/184557" target="_blank" rel="noopener">this</a> and <a href="https://community.tableau.com/thread/263938" target="_blank" rel="noopener">this one</a>.  So if we use SQL Server to wrap those complex queries then it becomes much simpler because Tableau has very good support for SQL Server compared to 3rd party ODBC Drivers.</p>
<p>To access REST API in tableau using SQL Server Connection, you have to perform the following high level steps.</p>
<ol>
<li>Make sure you have access to Microsoft SQL Server instance. If you don&#8217;t have one you can always use lightweight <a href="https://www.microsoft.com/en-us/sql-server/sql-server-editions-express" target="_blank" rel="noopener">FREE SQL Express Edition (Download)</a>. This is free for Production use too.</li>
<li>Install <a href="https://zappysys.com/products/odbc-powerpack/" target="_blank" rel="noopener">ZappySys ODBC PowerPack (API Drivers)</a></li>
<li>Configure <a href="https://zappysys.com/products/odbc-powerpack/data-gateway/" target="_blank" rel="noopener">ZappySys Data Gateway</a> (Create API connection) &#8211; We will see in depth, later in this article.</li>
<li>Create Linked Server in Microsoft SQL Server and connect to ZappySys Data Gateway</li>
<li>Import API data in Tableau using Microsoft SQL Server Connector by calling Linked Server SQL Queries</li>
</ol>
<p>Assuming you have already done first step lets get started with remaining steps. You can also read this article for other example of <a href="https://zappysys.com/blog/import-rest-api-json-sql-server/" target="_blank" rel="noopener">calling SQL Server Queries via ZappySys Data Gateway</a>.</p>
<h3>Configure ZappySys Data Gateway</h3>
<div class="content_block" id="custom_post_widget-5282">Now let's look at how to configure <a href="https://zappysys.com/products/odbc-powerpack/data-gateway/" target="_blank" rel="noopener">ZappySys Data Gateway</a>. This feature acts as a bridge between Client App and ZappySys Drivers. Using data gateway you can use ZappySys Drivers inside applications / operating systems where ZappySys drivers may not be available directly for some reason (e.g. You don't have access to Server for Installation or System does not support ODBC drivers like JAVA programs). <a href="https://zappysys.com/blog/category/odbc-powerpack/odbc-gateway/">Click here to read more</a> on various use cases of Data Gateway.
<h4><span style="font-size: 14pt;">Configure Data Gateway User / Port</span></h4>
Now let's look at steps to configure Data Gateway after installation. We will also create a sample data source for ODATA API (i.e. JSON based REST API Service).
<ol>
 	<li>Assuming you have installed <a href="https://zappysys.com/products/odbc-powerpack/" target="_blank" rel="noopener">ZappySys ODBC PowerPack</a> using default options (Which also enables Data Gateway Service)</li>
 	<li>Search "Gateway" in your start menu and click ZappySys Data Gateway
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/11/start-menu-open-zappysys-data-gateway.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2018/11/start-menu-open-zappysys-data-gateway.png" alt="Open ZappySys Data Gateway" /></a>
<p class="wp-caption-text">Open ZappySys Data Gateway</p>

</div></li>
 	<li>First make sure Gateway Service is running (Verify Start icon is disabled)</li>
 	<li>Also verify Port on General Tab
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/11/odbc-configure-data-gateway-json-1.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2018/11/odbc-configure-data-gateway-json-1.png" alt="Port Number setting on ZappySys Data Gateway" /></a>
<p class="wp-caption-text">Port Number setting on ZappySys Data Gateway</p>

</div></li>
 	<li>Now go to Users tab. <strong>Click Add</strong> icon to add a new user. Check Is admin to give access to all data sources you add in future. If you don't check admin then you have to manually configure user permission for each data source.
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/11/odbc-configure-data-gateway-json-2.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2018/11/odbc-configure-data-gateway-json-2.png" alt="Add Data Gateway User" /></a>
<p class="wp-caption-text">Add Data Gateway User</p>

</div></li>
</ol>
&nbsp;
<h4><span style="font-size: 14pt;">Configure Data Source</span></h4>
<ol>
 	<li>After user is added, go to Data Sources tab. <strong>Click Add</strong> icon to create new data source. Select appropriate driver based on your API / File format. You can choose Generic ODBC option to read data from ODBC DSN or use Native Driver option.
<pre class=""><strong>NOTE:</strong> Whenever possible use native driver option for better performance / security and ease of use.</pre>
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/11/odbc-configure-data-gateway-json-3.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2018/11/odbc-configure-data-gateway-json-3.png" alt="Add Gateway Data Source (Native JSON Driver)" /></a>
<p class="wp-caption-text">Add Gateway Data Source (Native JSON Driver)</p>

</div></li>
 	<li>Click on "Edit" under Data source and configure as per your need (e.g. Url, Connection, Request Method, Content Type, Body, Pagination etc.). For this demo we are going to pick simple JSON REST API which doesn't need any authentication.  Enter following URL.
<pre class="">https://services.odata.org/V3/Northwind/Northwind.svc/Invoices?$format=json</pre>
</li>
 	<li>You can also view response structure and select default hierarchy (i.e. Filter) like below (Select Array Icon) for data extraction.
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/11/odbc-configure-data-gateway-json-4.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2018/11/odbc-configure-data-gateway-json-4.png" alt="Configure JSON API Data source" /></a>
<p class="wp-caption-text">Configure JSON API Data source</p>

</div></li>
</ol>
<h4><span style="font-size: 14pt;">Test SQL Query / Preview Data</span></h4>
<ol>
 	<li>Now go to Preview Tab. You can click Preview button to execute default query
OR
Select Table name from dropdown to generate SQL with column names.
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/11/odbc-configure-data-gateway-json-5.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2018/11/odbc-configure-data-gateway-json-5.png" alt="JSON / REST API Driver Query Preview / Query Examples (Read REST API or JSON Files)" /></a>
<p class="wp-caption-text">JSON / REST API Driver Query Preview / Query Examples (Read REST API or JSON Files)</p>

</div></li>
 	<li>You can also click Query Builder to generate SQL using different options in WITH clause. ANy setting you specify in WITH clause will override UI settings we applied in previous steps.
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/11/odbc-configure-data-gateway-json-6.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2018/11/odbc-configure-data-gateway-json-6.png" alt="Using SQL Query Builder (For Files or REST / SOAP API - JSON / XML / CSV Format)" /></a>
<p class="wp-caption-text">Using SQL Query Builder (For Files or REST / SOAP API - JSON / XML / CSV Format)</p>

</div></li>
 	<li>There is another useful option for code generation. Select your Language and quickly copy code snippet. See below Example of XML Driver Query to call SOAP API.
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/11/odbc-configure-data-gateway-json-7.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2018/11/odbc-configure-data-gateway-json-7.png" alt="Generate Example Code for ZappySys Driver" /></a>
<p class="wp-caption-text">Generate Example Code for ZappySys Driver</p>

</div></li>
 	<li><strong>Click OK</strong> to Close Data Source UI</li>
 	<li>Once data source is tested and configured you can <strong>click Save </strong>button in the Gateway UI toolbar and click <strong>Yes</strong> for <strong>Restart Service</strong>.</li>
</ol>
&nbsp;</div>
<h3>Create Linked Server in SQL Server</h3>
<p>Once REST API Data source is configured in ZappySys Data Gateway, we can move forward to creating Linked Server part. At this point, you must be wondering why I have to use SQL Server to call ZappySys ODBC Driver? Why can&#8217;t I directly use ZappySys ODBC Driver in Tableau?</p>
<p>Technically, you can use <a href="https://onlinehelp.tableau.com/current/pro/desktop/en-us/examples_otherdatabases.htm">Generic ODBC Connector in Tableau</a> to call ZappySys ODBC Drivers for JSON API / XML API or CSV API but there are many problems with it.</p>
<p>Tableau Generic ODBC Connection option generates many <a href="https://community.tableau.com/thread/227646">unsupported SQL Syntax</a> (e.g. Temp tables, Subqueries, date functions) which may not be supported by most non-relational ODBC drivers (e.g. ZappySys API drivers). Using SQL Server Linked Server we can bridge between ZappySys Drivers and Tableau to access any REST API. So let&#8217;s see how to do this.</p>
<div class="content_block" id="custom_post_widget-5289">Once you configured data source in Gateway, we can now setup Linked Server in SQL Server to query API data.
<ol style="margin-left: 10px;">
 	<li>Assuming you have installed SQL Server and SSMS. If not then get both for FREE from here: <a href="https://www.microsoft.com/en-us/sql-server/sql-server-editions-express">Get SQL Server Express</a> and  <a href="https://docs.microsoft.com/en-us/sql/ssms/download-sql-server-management-studio-ssms" target="_blank" rel="noopener">Get SSMS</a></li>
 	<li>Open SSMS and connect to SQL Server.</li>
 	<li>Go to Root &gt; Server Objects &gt; Linked Servers node. Right click and click <strong>New Linked Server...
</strong>
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/create-new-linked-server-ssms.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2018/03/create-new-linked-server-ssms.png" alt="Add Linked Server in SQL Server" />
</a>
<p class="wp-caption-text">Add Linked Server in SQL Server</p>

</div></li>
 	<li> Now enter linked server name, select Provider as SQL Native Client</li>
 	<li>Enter data source as <strong><span class="lang:default decode:true crayon-inline">GatewayServerName,PORT_NUMBER</span></strong> where server name is where ZappySys Gateway is running (Can be same as SQL Server machine or remote machine). Default PORT_NUMBER is 5000 but confirm on Data gateway &gt; General tab incase its different.</li>
 	<li>Enter Catalog Name. This must match name from Data gateway Data sources grid &gt; Name column
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/11/ssms-sql-server-configure-linked-server-2.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2018/11/ssms-sql-server-configure-linked-server-2.png" alt="Configure Linked Server Provider, Catalog, Server, Port for ZappySys Data Gateway Connection" />
</a>
<p class="wp-caption-text">Configure Linked Server Provider, Catalog, Server, Port for ZappySys Data Gateway Connection</p>
</div>
<div style="color: #31708f;background-color: #d9edf7;border-color: #bce8f1;padding: 15px;margin-bottom: 20px;border: 1px solid transparent;border-radius: 4px;">
<strong>INFO:</strong><br/>
<ul>
    <li>
      For <strong>SQL Server 2012, 2014, 2016, 2017, and 2019</strong>, use the <em>SQL Server Native Client 11.0</em> as the Provider.
    </li>
    <li>
      For <strong>SQL Server 2022 or higher</strong>, use the <em>Microsoft OLE DB Driver for SQL Server</em> as the Provider.
    </li>
  </ul>
</div></li>
 	<li>Click on Security Tab and select last option "<strong>Be made using this security context</strong>". Enter your gateway user account here.</li>
<li>
        <p>Optional: Under the Server Options Tab, Enable <b>RPC</b> and <b>RPC Out</b> and Disable Promotion of Distributed Transactions<b>(MSDTC)</b>.</p>
		<div class="wp-caption alignnone">
			<img decoding="async" class="block margin-bottom-10 img-thumbnail" src="https://zappysys.com/blog/wp-content/uploads/2018/11/linked-server-options-rpc-msdtc.png" title="RPC and MSDTC Settings" alt="RPC and MSDTC Settings" />
			<p class="wp-caption-text">RPC and MSDTC Settings</p>
		</div>
        <hr />
        <p>
            You need to enable RPC Out if you plan to use <b><i>EXEC(...) AT [MY_LINKED_SERVER_NAME]</i></b> rather than OPENQUERY.
            <br />
            If don't enabled it, you will encounter the <i>'Server "MY_LINKED_SERVER_NAME" is not configured for RPC'</i> error.
        </p>
        <p>
            Query Example:
            <code class="sql">EXEC('Select * from Products') AT [MY_LINKED_SERVER_NAME]</code>
        </p>
        <hr />
        <p>
            If you plan to use <b><i>'INSERT INTO...EXEC(....) AT [MY_LINKED_SERVER_NAME]'</i></b> in that case you need to Disable Promotion of Distributed Transactions(MSDTC).
            <br />
            If don't disabled it, you will encounter the <i>'The operation could not be performed because OLE DB provider "SQLNCLI11/MSOLEDBSQL" for linked server "MY_LINKED_SERVER_NAME" was unable to begin a distributed transaction.'</i> error.
        </p>
        <p>
            Query Example:
<pre class="">Insert Into dbo.Products 
EXEC('Select * from Products') AT [MY_LINKED_SERVER_NAME]</pre>
        </p>
        <hr />
</li>
 	<li>Click OK to save Linked Server</li>
 	<li>In SSMS execute below SQL query to test your connectivity.
<pre class="">SELECT * FROM OPENQUERY( MY_LINKED_SERVER_NAME, 'SELECT * FROM $')</pre>
--OR--
<pre class="">SELECT * FROM OPENQUERY( MY_LINKED_SERVER_NAME, 
'SELECT * FROM $
 WITH (Src=''https://services.odata.org/V3/Northwind/Northwind.svc/Customers?$format=json''
 ,Filter=''$.value[*]''
 ,DataFormat=''OData''
)');</pre>
</li>
 	<li>Here is the preview after you run some REST API query in SQL Server. Notice that you can override default configuration by supplying <a href="https://zappysys.com/onlinehelp/odbc-powerpack/scr/json-odbc-driver-connectionstring.htm" target="_blank" rel="noopener">many parameters</a> in WITH clause (second query example in screenshot).
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/11/query-rest-api-sql-server-linked-server-openquery-zappysys-data-gateway.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2018/11/query-rest-api-sql-server-linked-server-openquery-zappysys-data-gateway.png" alt="SSMS Output - Query REST API via Linked Server OPENQUERY statement (Connect to ZappySys Data Gateway)" />
</a>
<p class="wp-caption-text">SSMS Output - Query REST API via Linked Server OPENQUERY statement (Connect to ZappySys Data Gateway)</p>

</div></li>
 	<li>You can wrap your queries inside View or wrap inside Stored procedure to parameterize. Here is an example of create view which calls REST API queries. Below View can be consumed like a normal table from any Tools or Programming Language which supports connectivity to SQL Server.
<pre class="lang:tsql decode:true ">CREATE VIEW dbo.vwApiInvoices 
AS 
/*Call REST API inside SQL Server View*/
SELECT * FROM OPENQUERY( LS , 
'SELECT * FROM $
WITH (Src=''https://services.odata.org/V3/Northwind/Northwind.svc/Invoices?$format=json''
	 ,Filter=''$.value[*]''
	 ,DataFormat=''OData''
)');

GO
</pre>
&nbsp;</li>
 	<li>Notice in above approach if you parameterize Stored Procedure then <a href="https://zappysys.com/blog/create-csv-list-sql-server-table-columns-datatypes/" target="_blank" rel="noopener">check this article to understand Dynamic Metadata</a>.</li>
 	<li>That's it. We are now ready to move forward with more interesting things in next section.</li>
</ol></div>
<h3>Import REST API data in Tableau using Microsoft SQL Server Connector</h3>
<p>Now we are ready to call REST API in Tableau. Perform following steps to Connect REST API to Tableau.</p>
<ol>
<li>Open Tableau Desktop and click File &gt; New</li>
<li>To create new Connection click More &gt; Microsoft SQL Server &gt; Enter your credentials to connect to SQL Server.
<div id="attachment_5303" style="width: 765px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/11/tableau-connect-rest-api-data-microsoft-sql-server-driver.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5303" class="size-full wp-image-5303" src="https://zappysys.com/blog/wp-content/uploads/2018/11/tableau-connect-rest-api-data-microsoft-sql-server-driver.png" alt="Connect to REST API in Tableau using Microsoft SQL Server (Linked Server OPENQUERY approach)" width="755" height="690" srcset="https://zappysys.com/blog/wp-content/uploads/2018/11/tableau-connect-rest-api-data-microsoft-sql-server-driver.png 755w, https://zappysys.com/blog/wp-content/uploads/2018/11/tableau-connect-rest-api-data-microsoft-sql-server-driver-300x274.png 300w" sizes="(max-width: 755px) 100vw, 755px" /></a><p id="caption-attachment-5303" class="wp-caption-text">Connect to REST API in Tableau using Microsoft SQL Server (Linked Server OPENQUERY approach)</p></div></li>
<li>Once connection is created for SQL Server we can read REST API data 3 different ways
<ol>
<li>Query View which contains OPENQUERY to Linked Server for REST API data</li>
<li>Use direct SQL Query using OPENQUERY</li>
<li>Use Stored Procedure (Mostly useful to parameterize calls</li>
</ol>
</li>
<li>See below example to pull data from REST API in Tableau using SQL View approach
<div id="attachment_5302" style="width: 775px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/11/table-create-new-datasource-rest-api-query-json-xml-csv.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5302" class="size-full wp-image-5302" src="https://zappysys.com/blog/wp-content/uploads/2018/11/table-create-new-datasource-rest-api-query-json-xml-csv.png" alt="Create new Data Source in Tableau to Query REST API or file data (JSON / XML / CSV )" width="765" height="559" srcset="https://zappysys.com/blog/wp-content/uploads/2018/11/table-create-new-datasource-rest-api-query-json-xml-csv.png 765w, https://zappysys.com/blog/wp-content/uploads/2018/11/table-create-new-datasource-rest-api-query-json-xml-csv-300x219.png 300w" sizes="(max-width: 765px) 100vw, 765px" /></a><p id="caption-attachment-5302" class="wp-caption-text">Create new Data Source in Tableau to Query REST API or file data (JSON / XML / CSV )</p></div></li>
<li>Here is how to Create Data Source using direct SQL Query. You can enter following Example Query.<br />
<pre class="crayon-plain-tag">SELECT * FROM OPENQUERY( YOUR_LINKED_SERVER , 
'SELECT * FROM $
WITH (Src=''https://services.odata.org/V3/Northwind/Northwind.svc/Customers?$format=json''
	 ,Filter=''$.value[*]''
)');</pre>
&nbsp;</p>
<div id="attachment_5307" style="width: 1014px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/11/query-rest-api-data-in-tableu-datasource-sql-server-approach.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5307" class="size-full wp-image-5307" src="https://zappysys.com/blog/wp-content/uploads/2018/11/query-rest-api-data-in-tableu-datasource-sql-server-approach.png" alt="Create Tableau REST API Datasource using direct SQL Query" width="1004" height="470" srcset="https://zappysys.com/blog/wp-content/uploads/2018/11/query-rest-api-data-in-tableu-datasource-sql-server-approach.png 1004w, https://zappysys.com/blog/wp-content/uploads/2018/11/query-rest-api-data-in-tableu-datasource-sql-server-approach-300x140.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/11/query-rest-api-data-in-tableu-datasource-sql-server-approach-768x360.png 768w" sizes="(max-width: 1004px) 100vw, 1004px" /></a><p id="caption-attachment-5307" class="wp-caption-text">Create Tableau REST API Datasource using direct SQL Query</p></div></li>
<li>Once your data sources are created you can click on Sheet1 and drag fields to create visualizations for Tableau Dashboard.
<div id="attachment_5308" style="width: 867px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/11/tableau-dashboard-from-rest-api-example.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5308" class="size-full wp-image-5308" src="https://zappysys.com/blog/wp-content/uploads/2018/11/tableau-dashboard-from-rest-api-example.png" alt="Create Tableau Dashboard from REST API data (JSON / XML / CSV)" width="857" height="616" srcset="https://zappysys.com/blog/wp-content/uploads/2018/11/tableau-dashboard-from-rest-api-example.png 857w, https://zappysys.com/blog/wp-content/uploads/2018/11/tableau-dashboard-from-rest-api-example-300x216.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/11/tableau-dashboard-from-rest-api-example-768x552.png 768w" sizes="(max-width: 857px) 100vw, 857px" /></a><p id="caption-attachment-5308" class="wp-caption-text">Create Tableau Dashboard from REST API data (JSON / XML / CSV)</p></div></li>
</ol>
<h2>Passing Parameters to REST API calls in Tableau (Dynamic SQL)</h2>
<p>Now let&#8217;s look at scenario where you have to pass parameters to build Dynamic Dashboard. You can try to insert Parameters in your Direct SQL when you build Dynamic SQL but we found some issues with that so we are going to suggest Stored Procedure approach. For more information on Known issue on <a href="https://zappysys.com/blog/create-csv-list-sql-server-table-columns-datatypes/" target="_blank" rel="noopener">Dynamic Metadata Check this post</a>.</p>
<ol>
<li>First lets create a stored procedure in SQL Server for Parameter Example. Notice how we added WITH RESULT SETS in the code to <a href="https://zappysys.com/blog/create-csv-list-sql-server-table-columns-datatypes/" target="_blank" rel="noopener">describe metadata</a>.<br />
<pre class="crayon-plain-tag">--DROP PROC dbo.usp_GetInvoicesByCountry
--GO
/*
Purpose: Parameterize REST API call via SQL. Call ZappySys Drivers inside SQL Server.
*/
CREATE PROC dbo.usp_GetInvoicesByCountry
	@country varchar(100) 
AS 

DECLARE @sql varchar(max)
--//Escape single ticks carefully
SET @sql =  'SELECT OrderID,CustomerID,Country,Quantity FROM $
WITH (Src=''https://services.odata.org/V3/Northwind/Northwind.svc/Invoices?$format=json&amp;filter=Country eq '+ @country +'''
	 ,Filter=''$.value[*]''
	 ,DataFormat=''OData''
)'

DECLARE @sqlFull varchar(max)
SET @sqlFull='SELECT * FROM OPENQUERY( LS , ''' + REPLACE( @sql, '''', '''''' ) + ''' )'
PRINT @sqlFull --//For DEBUG purpose

EXECUTE (@sqlFull) 
WITH RESULT SETS ( 
 (OrderID int,CustomerID varchar(100),Country varchar(100),Quantity int) --//describe first result. If you don't do this then wont work in Tableau 
)
GO
-- Example call
EXEC dbo.usp_GetInvoicesByCountry @country='Germany'</pre>
</li>
<li>Once you create a stored procedure go to Tableau datasource and select Database which contains the stored procedure we just created.</li>
<li>Now find your stored proc and drag it on the datasource pane. You will see parameters UI as below. You can create new parameter &#8211; Select <strong>New Parameter</strong> under Value Column.
<div id="attachment_5310" style="width: 912px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/11/parameterize-tableau-datasource-call-rest-api-stored-procedure.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5310" class="size-full wp-image-5310" src="https://zappysys.com/blog/wp-content/uploads/2018/11/parameterize-tableau-datasource-call-rest-api-stored-procedure.png" alt="Parameterize Tableau REST API datasource (Stored Procedure Parameters)" width="902" height="634" srcset="https://zappysys.com/blog/wp-content/uploads/2018/11/parameterize-tableau-datasource-call-rest-api-stored-procedure.png 902w, https://zappysys.com/blog/wp-content/uploads/2018/11/parameterize-tableau-datasource-call-rest-api-stored-procedure-300x211.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/11/parameterize-tableau-datasource-call-rest-api-stored-procedure-768x540.png 768w" sizes="(max-width: 902px) 100vw, 902px" /></a><p id="caption-attachment-5310" class="wp-caption-text">Parameterize Tableau REST API datasource (Stored Procedure Parameters)</p></div></li>
<li>Thats it now you can reuse your parameterized datasource anywhere in Dashboard.</li>
<li>If you have need to select Parameters from predefined values rather than free text then edit your parameter and select <strong>List</strong> option. Define values you like to select from as below.
<div id="attachment_5311" style="width: 960px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/11/allow-multiple-values-tableau-parameters.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5311" class="size-full wp-image-5311" src="https://zappysys.com/blog/wp-content/uploads/2018/11/allow-multiple-values-tableau-parameters.png" alt="Allow Tableau Parameter selection from multiple values" width="950" height="568" srcset="https://zappysys.com/blog/wp-content/uploads/2018/11/allow-multiple-values-tableau-parameters.png 950w, https://zappysys.com/blog/wp-content/uploads/2018/11/allow-multiple-values-tableau-parameters-300x179.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/11/allow-multiple-values-tableau-parameters-768x459.png 768w" sizes="(max-width: 950px) 100vw, 950px" /></a><p id="caption-attachment-5311" class="wp-caption-text">Allow Tableau Parameter selection from multiple values</p></div></li>
<li>When you create Tableau Dashboard you will see Parameter dropdown (If you selected List) elase you may see Textbox to enter custom value.
<div id="attachment_5312" style="width: 918px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/11/tableau-dashboard-rest-api-example-with-parameters.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5312" class="size-full wp-image-5312" src="https://zappysys.com/blog/wp-content/uploads/2018/11/tableau-dashboard-rest-api-example-with-parameters.png" alt="Tableau Dashboard Example - REST API Source with Parameterized Datasource" width="908" height="668" srcset="https://zappysys.com/blog/wp-content/uploads/2018/11/tableau-dashboard-rest-api-example-with-parameters.png 908w, https://zappysys.com/blog/wp-content/uploads/2018/11/tableau-dashboard-rest-api-example-with-parameters-300x221.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/11/tableau-dashboard-rest-api-example-with-parameters-768x565.png 768w" sizes="(max-width: 908px) 100vw, 908px" /></a><p id="caption-attachment-5312" class="wp-caption-text">Tableau Dashboard Example &#8211; REST API Source with Parameterized Datasource</p></div></li>
</ol>
<h2></h2>
<h2>Read data from JSON Files in Tableau (Single or Multiple)</h2>
<p>So far we have seen how to read data from REST API but there will be a time to read data from JSON Files (Single or Multiple). Also files may be compressed (GZip or Zip). Regardless no worries if you are using ZappySys drivers. See below sample query you can submit via SQL Linked Server to read JSON files stored on network share.</p>
<p><strong>Single File Example</strong></p><pre class="crayon-plain-tag">SELECT * FROM OPENQUERY([MY_LINKED_SERVER]
, 'SELECT * FROM $
WITH(
   Src=''c:\ssis\large_2018.json''
  ,Filter=''$.Branches[*]''
)')</pre><p>
<strong>Multiple Files Example</strong></p><pre class="crayon-plain-tag">SELECT * FROM OPENQUERY([MY_LINKED_SERVER]
, 'SELECT * FROM $
WITH(
   Src=''c:\ssis\large_*.json''
  ,Filter=''$.Branches[*]''
)')</pre><p>
<strong>Read Compressed Files (GZip / Zip Format)</strong></p><pre class="crayon-plain-tag">SELECT * FROM OPENQUERY([MY_LINKED_SERVER]
, 'SELECT * FROM $
WITH(
   Src=''c:\ssis\large_*.json.gz''
  --Src=''https://zappysys.com/downloads/files/test/large_file_10k.json.gz''
  ,Filter=''$.Branches[*]''
  ,FileCompressionType=''GZip''  --OR-- Zip --OR-- None
)')</pre><p>
&nbsp;</p>
<h2>Read CSV Files or URL in Tableau</h2>
<p>If you like to read data from CSV files or URL then you can use <a href="https://zappysys.com/products/odbc-powerpack/odbc-csv-rest-api-driver/" target="_blank" rel="noopener">ZappySys CSV Driver</a> same way.</p>
<p>Here is sample query for CSV data.</p>
<p><strong>Reading Compressed CSV Files in Tableau</strong></p><pre class="crayon-plain-tag">SELECT * FROM OPENQUERY([MY_API_SERVICE]
, 'SELECT * FROM $
WITH(
  Src=''https://zappysys.com/downloads/files/test/customerdata.csv.gz''
  ,FileCompressionType=''GZip''  --OR-- Zip --OR-- None
  ,ColumnDelimiter=''|''
  ,HasColumnHeaderRow=''False''
)')</pre><p>
<strong>Read multiple files (TAB delimited) in Tableau</strong></p><pre class="crayon-plain-tag">SELECT * FROM OPENQUERY([MY_API_SERVICE]
, 'SELECT * FROM $
WITH(
  Src=''''c:\ssis\customerdata_*.csv''''
  ,ColumnDelimiter=''{tab}'' --or use \t for tab delimited files
  ,HasColumnHeaderRow=''True''
)')</pre><p>
<h2>Read XML Files or API in Tableau</h2>
<p>If you like to read data from XML files or URL then you can use <a href="https://zappysys.com/products/odbc-powerpack/odbc-xml-soap-api-driver/" target="_blank" rel="noopener">ZappySys XML Driver</a> same way. See below example to read some data from XML Web API. We have also passed credentials along with it for demo purpose.</p><pre class="crayon-plain-tag">SELECT * FROM OPENQUERY([MY_API_SERVICE]
, 'SELECT * FROM $
WITH(
	 ElementsToTreatAsArray=''item,slide''
	,Src=''http://httpbin.org/xml''
	,DataConnectionType=''HTTP''
	,UserName=''user1''
	,CredentialType=''Basic''
	,Password=''P@11s#''
	,Filter=''$.slideshow.slide[*]''
)')</pre><p>
<strong>Read local XML files</strong></p><pre class="crayon-plain-tag">SELECT * FROM OPENQUERY([MY_API_SERVICE]
, 'SELECT * FROM $ WITH (
 SRC=''C:\Data\CustomerData.xml''
, Filter=''$.Root.Row[*]''
, ElementsToTreatAsArray=''Row''
)')</pre><p>
&nbsp;</p>
<h2>Call POST REST API in Tableau</h2>
<p>There will be a time when you like to submit API request as POST rather than GET. See below example how to write POST API Request to send Body along with Custom Headers and Method.</p>
<p><strong>POST Body, Set Method, Headers</strong></p><pre class="crayon-plain-tag">SELECT * FROM OPENQUERY([MY_API_SERVICE]
, 'SELECT * FROM $
WITH 
(METHOD=''POST'', HEADER=''Content-Type: text/plain || x-hdr1: AAA''
,SRC=''http://httpbin.org/post''
,BODY=''
{
    id:1,
    notes:"Line1\r\nLine2"
}''
)')</pre><p>
<strong>Call SOAP API using XML Driver (POST data) &#8211; Token based Authentication</strong></p>
<p>Here is another interesting example to call XML SOAP API. It first authenticates and get Token from SOAP Response. Then use that token for API call. To read more about <a href="https://zappysys.com/blog/call-soap-rest-api-using-dynamic-token-ssis/" target="_blank" rel="noopener">Dynamic Token Method check this article</a>.</p><pre class="crayon-plain-tag">SELECT * FROM OPENQUERY([MY_API_SERVICE]
, 'SELECT * FROM $
WITH(
	 ElementsToTreatAsArray=''urn:Row''
	,Src=''https://zappysys.com/downloads/files/test/soap-getdata.aspx''
	,DataConnectionType=''HTTP''
	,AuthScheme=''{none}''
	,TokenUrl=''https://zappysys.com/downloads/files/test/soap-login.aspx''
	,TokenRequestData=''
&lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:partner.soap.sforce.com"&gt;
   &lt;soapenv:Body&gt;
      &lt;urn:login&gt;
         &lt;urn:username&gt;[$userid$]&lt;/urn:username&gt;
         &lt;urn:password&gt;[$password$]&lt;/urn:password&gt;
      &lt;/urn:login&gt;
   &lt;/soapenv:Body&gt;
&lt;/soapenv:Envelope&gt;''

	,TokenRequestMethod=''POST''
	,TokenResponseContentFilter=''//*[local-name() = ''''sessionid'''']''
	,TokenRequestHeaders=''Content-Type:text/xml|Accept:*/*|Cache-Control:no-cache''
	,TokenResponseContentType=''Xml''
	,UserName=''MyUser001''
    ,Password=''P@$$w0rdAAc12''
	,CredentialType=''TokenDynamic''
	,Filter=''$.soapenv:Envelope.soapenv:Body.urn:Row[*]''
	,RequestData=''
&lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:partner.soap.sforce.com"&gt;
   &lt;soapenv:Body&gt;
      &lt;urn:sessionid&gt;[$token$]&lt;/urn:sessionid&gt;
   &lt;/soapenv:Body&gt;
&lt;/soapenv:Envelope&gt;''

	,Header=''Content-Type: text/xml;charset=UTF-8 || SOAPAction: "https://zappysys.com/soap-getdata" || Accept: */* || Cache-Control: no-cache''
	,RequestMethod=''POST''
)')</pre><p>
&nbsp;</p>
<p>&nbsp;</p>
<h2>REST API / XML SOAP Pagination Settings for Tableau</h2>
<div class="content_block" id="custom_post_widget-3892"><div style="margin-bottom: 1em;">Even we set up ODBC Data Source to get the data, it may not be enough. Usually, if you are getting a huge data set from API provider, it won't give it to you in one HTTP response. Instead, it gives back only a subset of data and provides a mechanism for data pagination. The good news is that <em>ZappySys ODBC Driver</em> includes many options to cover virtually any pagination method.</div>
<div><span style="font-size: 16px;">Below you will find a few examples of API pagination. If you need something more sophisticated check the below link (the article was written for SSIS PowerPack but UI options and concepts apply to ODBC Driver too):</span></div>
<div style="margin-bottom: 1em;"><a href="https://zappysys.com/blog/ssis-rest-api-looping-until-no-more-pages-found/" target="_blank" rel="noopener">https://zappysys.com/blog/ssis-rest-api-looping-until-no-more-pages-found/</a></div>
<h3>Paginate by Response Attribute</h3>
This example shows how to paginate API calls where you need to paginate until the last page detected. In this example, next page is indicated by some attribute called nextlink (found in response). If this attribute is missing or null then it stops fetching the next page.
<pre class="lang:tsql decode:true codeblock">SELECT * FROM $
WITH(
SRC=@'https://zappysys.com/downloads/files/test/pagination_nextlink_inarray_1.json'
,NextUrlAttributeOrExpr = '$.nextlink'  --keep reading until this attribute is missing. If attribute name contains dot then use brackets like this $.['my.attr.name']
)</pre>
<h3>Paginate by URL Parameter (Loop until certain StatusCode)</h3>
This example shows how to paginate API calls where you need to pass page number via URL. The driver keeps incrementing page number and calls next URL until the last page detected (401 error). There are few ways to indicate the last page (e.g. By status code, By row count, By response size). If you don't specify end detection then it will use the default (i.e. No records found).
<pre class="lang:tsql decode:true codeblock">SELECT * FROM $
WITH (
SRC=@'https://zappysys.com/downloads/files/test/page-xml.aspx?page=1&amp;mode=DetectBasedOnResponseStatusCode'
,PagingMode='ByUrlParameter'
,PagingByUrlAttributeName='page'
,PagingByUrlEndStrategy='DetectBasedOnResponseStatusCode'
,PagingByUrlCheckResponseStatusCode=401
,IncrementBy=1
)</pre>
<h3>Paginate by URL Path (Loop until no record)</h3>
This example shows how to paginate API calls where you need to pass page number via URL Path. The driver keeps incrementing page number and calls next URL until the last page is detected. There are few ways to indicate the last page (e.g. By status code, By row count, By response size). If you don't specify end detection then it will use the default (i.e. No records found).
<pre class="lang:tsql decode:true codeblock">SELECT * FROM $
WITH (
SRC=@'https://zappysys.com/downloads/files/test/cust-&lt;%page%&gt;.xml'
,PagingMode='ByUrlPath'
,PagingByUrlAttributeName='&lt;%page%&gt;'
,PagingByUrlEndStrategy='DetectBasedOnRecordCount'
,IncrementBy=1
)</pre>
<h3>Paginate by Header Link (RFC 5988)</h3>
API like GitHub / Wordpress use Next link in Headers (<a href="https://tools.ietf.org/html/rfc5988" target="_blank" rel="noopener">RFC 5988</a>)
<pre class="lang:default decode:true ">SELECT * FROM $
LIMIT 25
WITH(
	 Src='https://wordpress.org/news/wp-json/wp/v2/categories?per_page=10'
	,PagingMode='ByResponseHeaderRfc5988'
	,WaitTimeMs='200' --//wait 200 ms after each request
)</pre>
&nbsp;</div>
<h2>REST API / SOAP Web Service Connection Settings for Tableau</h2>
<div class="content_block" id="custom_post_widget-3896"><div style="margin-bottom: 1em;">If you need to authenticate or authorize your user to access a web resource, you will need to use one of the <em>Connections:</em></div>
<ul>
 	<li>HTTP</li>
 	<li>OAuth</li>
</ul>
<img loading="lazy" decoding="async" class="wp-image-4078 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-powerpack-authentication-authorization-e1529337108252.png" alt="ZappySys XML Driver - HTTP and OAuth Connection Types" width="577" height="302" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-powerpack-authentication-authorization-e1529337108252.png 577w, https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-powerpack-authentication-authorization-e1529337108252-300x157.png 300w" sizes="(max-width: 577px) 100vw, 577px" />
<h3>HTTP Connection</h3>
<div style="margin-bottom: 1em;">Use <em>HTTP Connection</em> for simple Windows, Basic, NTLM or Kerberos authentication. Just fill in a username and a password and you are good to go!</div>
<div style="margin-bottom: 1em;">You can also use <em>HTTP Connection</em> for more sophisticated authentication like:</div>
<ul>
 	<li><strong>SOAP WSS</strong> (when accessing a SOAP WebService)</li>
 	<li><strong>Static Token / API Key</strong> (when need to pass an API key in HTTP header)</li>
 	<li><strong>Dynamic Token</strong> (same as Static Token method except that each time you need to log in and retrieve a fresh API key)</li>
 	<li><strong>JWT Token</strong> (As per RFC 7519)</li>
</ul>
<img loading="lazy" decoding="async" class="alignnone wp-image-4091 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-api-connection-type-1.png" alt="" width="622" height="570" />
<h3>OAuth</h3>
If you are trying to access REST API resource, it is a huge chance, you will need to use <em>OAuth Connection</em>. <a href="https://zappysys.com/blog/rest-api-authentication-with-oauth-2-0-using-ssis/" target="_blank" rel="noopener">Read this article</a> to understand how OAuth authentication and authorization works and how to use it (article originally was written for <a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">SSIS PowerPack</a>, but the concepts and UI stay the same): <br/>
<a href="https://zappysys.com/blog/rest-api-authentication-with-oauth-2-0-using-ssis/" target="_blank" rel="noopener">https://zappysys.com/blog/rest-api-authentication-with-oauth-2-0-using-ssis/</a>
<img loading="lazy" decoding="async" class="alignnone size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-api-connection-type-2.png" width="721" height="708" /></div>
<h2>Other settings for REST API / SOAP XML Call in Tableau</h2>
<div class="content_block" id="custom_post_widget-3901">There are few settings you can coder while calling Web API
<h3><strong>API Limit / Throttling</strong></h3>
While calling public API or other external web services one important aspect you have to check,  how many requests are allowed by your API. Especially when you use API pagination options to pull many records you have to slow down based on API limits. For example, your API may allow you only 5 requests per second. Use Throttling Tab on Driver UI to set delay after each request.
<h3><strong>2D Array Transformation</strong></h3>
If you are using JSON or XML API Driver then possible you may have to transform your data using 2D array transformation feature. <a href="https://zappysys.com/blog/parse-multi-dimensional-json-array-ssis/" target="_blank" rel="noopener">Check this link</a> for more information.

&nbsp;</div>
<h2>REST API / XML SOAP Performance Tips for Tableau</h2>
<div class="content_block" id="custom_post_widget-4455">While calling APIs you may face some performance issues. There are a few tips you can consider to speed up things.
<h4><span style="font-size: 14pt;"><strong>Use Server-side filtering if possible in URL or Body Parameters</strong></span></h4>
Many API supports filtering your data by URL parameters or via Body. Whenever possible try to use such features.  Here is an example of <a href="http://www.odata.org/getting-started/basic-tutorial/" target="_blank" rel="noopener">odata API</a>, In the below query the first query is faster than the second query because in the first query we filter at the server.
<pre class="lang:tsql decode:true">SELECT * FROM value
WITH(
	 Src='https://services.odata.org/V3/Northwind/Northwind.svc/Customers?$format=json&amp;$filter=Country eq ''USA'''
	,DataFormat='Odata'
)

-- Slow query - Client-side filtering
SELECT * FROM value
WHERE Country ='USA'
WITH(
	 Src='https://services.odata.org/V3/Northwind/Northwind.svc/Customers?$format=json'
	,DataFormat='Odata'
)</pre>
<h4><span style="font-size: 14pt;"><strong>Avoid Special features in SQL Query (e.g. WHERE, Group By, Order By)</strong></span></h4>
ZappySys API engine triggers client-side processing if special features are used in Query. Following SQL Features will trigger Client-Side processing which is several times slower than server-side processing. So always try to use simple query (Select col1, col2 .... from mytable )
<ul>
 	<li>WHERE Clause</li>
 	<li>GROUP BY Clause</li>
 	<li>HAVING Clause</li>
 	<li>ORDER BY</li>
 	<li>FUNCTIONS (e.g. Math, String, DateTime, Regex... )</li>
</ul>
LIMIT clause does not trigger client-side processing.
<h4><span style="font-size: 14pt;"><strong>Consider using pre-generated Metadata / Cache File</strong></span></h4>
Use META option in WITH Clause to use static metadata (Pre-Generated)There are two more options to speedup query processing time. Check <a href="https://zappysys.com/blog/caching-metadata-odbc-drivers-performance/" target="_blank" rel="noopener">this article</a> for details.
<ol>
 	<li>
<pre class="lang:default decode:true">select * from value WITH( meta='c:\temp\meta.txt' )
--OR--
select * from value WITH( meta='my-meta-name' )
--OR--
select * from value WITH( meta='[ {"Name": "col1",&amp;nbsp;"Type": "String", Length: 100},&amp;nbsp;{"Name": "col2",&amp;nbsp;"Type": "Int32"} ...... ]' )</pre>
</li>
 	<li>Enable Data Caching Options (Found on <strong>Property Grid</strong> &gt; <strong>Advanced</strong> Mode Only )</li>
</ol>
<h4><span style="font-size: 14pt;"><strong>Consider using Metadata / Data Caching Option</strong></span></h4>
ZappySys API drivers support Caching Metadata and Data rows to speed up query processing. If your data doesn't change often then you can enable this option to speed up processing significantly.

Check <a href="https://zappysys.com/blog/caching-metadata-odbc-drivers-performance/" target="_blank" rel="noopener">this article</a> for details how to enable Data cache / metadata cache feature for datasource level or query level.

To define cache option at query level you can use like below.
<pre class="">SELECT * FROM $
WITH 
(  SRC='https://myhost.com/some-api'
  ,CachingMode='All'  --cache metadata and data rows both
  ,CacheStorage='File' --or Memory
  ,CacheFileLocation='c:\temp\myquery.cache'
  ,CacheEntryTtl=300 --cache for 300 seconds
)
</pre>
&nbsp;

&nbsp;
<h4><strong><span style="font-size: 14pt;">Use --FAST Option to enable Stream Mode</span></strong></h4>
ZappySys JSON / XML drivers support <strong>--FAST</strong> suffix for Filter. By using this suffix after Filter driver enables Stream Mode, <a href="https://zappysys.com/blog/caching-metadata-odbc-drivers-performance/#Reading_Large_Files_Streaming_Mode_for_XML_JSON" target="_blank" rel="noopener">Read this article</a> to understand how this works.
<pre class="lang:default decode:true">SELECT * FROM $ 
LIMIT 10 --//add this just to test how fast you can get 10 rows
WITH(
  Filter='$.LargeArray[*]--FAST' --//Adding --FAST option turn on STREAM mode (large files)
 ,SRC='https://zappysys.com/downloads/files/test/large_file_100k_largearray_prop.json.gz'
 --,SRC='c:\data\large_file.json.gz'
 ,IncludeParentColumns='False'  --//This Must be OFF for STREAM mode (read very large files)
 ,FileCompressionType='GZip' --Zip or None (Zip format only available for Local files)
)</pre>
&nbsp;</div>
<h2>Calling SOAP Web Service in Tableau</h2>
<div class="content_block" id="custom_post_widget-3870">To call SOAP API you need to know Request XML Body Structure. If you are not sure how to create SOAP Request body then no worries. <a href="https://zappysys.com/blog/calling-soap-web-service-in-ssis-xml-source/" target="_blank" rel="noopener">Check this article</a> to learn how to generate SOAP Request body using the Free tool <a href="https://www.soapui.org/downloads/latest-release.html" target="_blank" rel="noopener">SoapUI</a>. Basically, you have to use SoapUI to generate Request XML and after that, you can replace parameters as needed in the generated body.
<h3>What is SOAP Web Service?</h3>
If you are new to SOAP Web Service sometimes referred as XML Web Service then please read some concept about SOAP Web service standard <a href="https://msdn.microsoft.com/en-us/library/ms996507.aspx?f=255&amp;MSPPError=-2147217396" target="_blank" rel="noopener">from this link</a>

There are two important aspects in SOAP Web service.
<ol>
 	<li>Getting WSDL file or URL</li>
 	<li>Knowing exact Web Service URL</li>
</ol>
<h3>What is WSDL</h3>
In very simple term WSDL (often pronounced as whiz-dull) is nothing but a document which describes Service metadata (e.g. Functions you can call, Request parameters, response structure etc). Some service simply give you WSDL as xml file you can download on local machine and then analyze or sometimes you may get direct URL (e.g. http://api.mycompany.com/hr-soap-service/?wsdl )
<h3>Example SQL Query for SOAP API call using ZappySys XML Driver</h3>
Here is an example SQL query you can write to call SOAP API. If you not sure about many details then check next few sections on how to use XML Driver User Interface to build desired SQL query to POST data to XML SOAP Web Service without any coding.
<pre class="lang:tsql decode:true">SELECT * FROM $
WITH(
	 Src='http://www.holidaywebservice.com/HolidayService_v2/HolidayService2.asmx'
	,DataConnectionType='HTTP'
	,CredentialType='Basic' --OR SoapWss
	,SoapWssPasswordType='PasswordText'
	,UserName='myuser'
	,Password='pass$$w123'
	,Filter='$.soap:Envelope.soap:Body.GetHolidaysAvailableResponse.GetHolidaysAvailableResult.HolidayCode[*]'
	,ElementsToTreatAsArray='HolidayCode'	
	,RequestMethod='POST'	
	,Header='Content-Type: text/xml;charset=UTF-8 || SOAPAction: "http://www.holidaywebservice.com/HolidayService_v2/GetHolidaysAvailable"'
	,RequestData='
&lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:hol="http://www.holidaywebservice.com/HolidayService_v2/"&gt;
   &lt;soapenv:Header/&gt;
   &lt;soapenv:Body&gt;
      &lt;hol:GetHolidaysAvailable&gt;
         &lt;!--type: Country - enumeration: [Canada,GreatBritain,IrelandNorthern,IrelandRepublicOf,Scotland,UnitedStates]--&gt;
         &lt;hol:countryCode&gt;UnitedStates&lt;/hol:countryCode&gt;
      &lt;/hol:GetHolidaysAvailable&gt;
   &lt;/soapenv:Body&gt;
&lt;/soapenv:Envelope&gt;'
)</pre>
Now let's look at steps to create SQL query to call SOAP API. Later we will see how to generate code for your desired programming language (e.g. C# or SQL Server)
<h3>Video Tutorial - Introduction to SOAP Web Service and SoapUI tool</h3>
Before we dive into details about calling SOAP API using ZappySys XML Driver, lets first understand what is SOAP API and how to create SOAP requests using SoapUI tool. You will learn more about this process in the later section. The video contains some fragment about using SOAP API in SSIS but just ignore that part because we will be calling Soap API using ZappySys ODBC Driver rather than SSIS Components.

&nbsp;

<iframe loading="lazy" width="560" height="315" src="https://www.youtube.com/embed/d_x5bgGjg0Y?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen="allowfullscreen" data-mce-fragment="1"></iframe>
<h3>Using SoapUI to test SOAP API call / Create Request Body XML</h3>
Assuming you have downloaded and installed <a href="https://www.soapui.org/downloads/latest-release.html" target="_blank" rel="noopener">SoapUI from here</a>, now we are ready to use WSDL for your SOAP Web Service Calls. If you do not have WSDL file or URL handy then contact your API provider (sometimes you just have to add <strong>?wsdl </strong>at the end of your Service URL to get WSDL so try that. Example: http://mycompany/myservice?wsdl ).

If you don't know what is WSDL then in short, WSDL is <strong>Web service Description Language</strong> (i.e. XML file which describes your SOAP Service). WSDL helps to craft SOAP API request Body for ZappySys XML Driver. So Let's get started.
<ol>
 	<li>Open SoapUI and click SOAP button to create new SOAP Project</li>
 	<li>Enter WSDL URL or File Path of WSDLFor example WSDL for our sample service can be accessed via this URL
<pre class="lang:default highlight:0 decode:true">http://www.dneonline.com/calculator.asmx?wsdl</pre>
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/calling-soap-api-import-wsdl-new-soapui-project.png"><img loading="lazy" decoding="async" class="size-full wp-image-3871" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-14.png" alt="Create new SOAP API Project in SoapUI tool for SOAP API Testing" width="486" height="349" /></a>
<div style="margin-bottom: 1em;">Create new SOAP API Project in SoapUI tool for SOAP API Testing</div></li>
 	<li>Once WSDL is loaded you will see possible operations you can call for your SOAP Web Service.</li>
 	<li>If your web service requires credentials then you have to configure it. There are two common credential types for public services (<strong>SOAP WSS</strong> or <strong>BASIC</strong> )
<ol>
 	<li>
<div style="margin-bottom: 1em;">To use <strong>SOAP WSS Credentials</strong> select request node and enter UserId, Password, and <strong>WSS-PasswordType</strong> (PasswordText or PasswordHash)</div>
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/calling-soap-api-pass-soap-wss-credentials-userid-password.png"><img loading="lazy" decoding="async" class="size-full wp-image-3872 alignnone" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-2.png" alt="Configure SOAP WSS Credentials for SoapUI (SOAP API Testing Tool)" width="294" height="544" /></a>
<div style="display: block;">Configure SOAP WSS Credentials for SoapUI (SOAP API Testing Tool)</div></li>
 	<li>To use <strong>BASIC Auth</strong> Credentials select request node and double-click it. At the bottom click on Auth (Basic) and From Authorization dropdown click Add New and Select Basic.<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/calling-soap-api-pass-basic-authentication-userid-password.png"><img loading="lazy" decoding="async" class="size-full wp-image-3873" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-2.png" alt="Configure Basic Authorization for SoapUI (SOAP API Testing Tool)" width="616" height="653" /></a>
<div style="margin-bottom: 1em;">Configure Basic Authorization for SoapUI (SOAP API Testing Tool)</div></li>
</ol>
</li>
 	<li>Now you can test your request first Double-click on the request node to open request editor.</li>
 	<li>Change necessary parameters, remove optional or unwanted parameters. If you want to regenerate request you can click on <strong>Recreate default request toolbar icon</strong>.
<a href="https://zappysys.com/blog/wp-content/uploads/2016/06/create-soap-request-with-optional-parameters-soapui.png"><img loading="lazy" decoding="async" class="size-full wp-image-2812" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-4.png" alt="Create SOAP Request XML (With Optional Parameters)" width="807" height="315" /></a>
<div style="margin-bottom: 1em;">Create SOAP Request XML (With Optional Parameters)</div></li>
 	<li>Once your SOAP Request XML is ready, <strong>Click the Play button</strong> in the toolbar to execute SOAP API Request and Response will appear in Right side panel.
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/soapui-test-soap-api-request-response-edit-xml-body.png"><img loading="lazy" decoding="async" class="size-full wp-image-3874" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-5.png" alt="Test SOAP API using SoapUI Tool (Change Default XML Body / Parameters, Execute and See Response)" width="1216" height="511" /></a>
Test SOAP API using SoapUI Tool (Change Default XML Body / Parameters, Execute and See Response)</li>
</ol>
<h3>Create DSN using ZappySys XML Driver to call SOAP API</h3>
Once you have tested your SOAP API in SoapUI tool, we are ready to use ZappySys XML driver to call SOAP API in your preferred BI tool or Programming language.
<ol>
 	<li>First open <strong>ODBC Data Sources</strong> (search ODBC in your start menu or go under ZappySys &gt; ODBC PowerPack &gt; <strong>ODBC 64 bit</strong>)</li>
 	<li>Goto <strong>System DSN</strong> Tab (or User DSN which is not used by Service account)</li>
 	<li>Click <strong>Add</strong> and Select ZappySys XML Driver
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/zappysys-odbc-xml-soap-api-driver.png"><img loading="lazy" decoding="async" class="size-full wp-image-3875" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-6.png" alt="ZappySys ODBC Driver for XML / SOAP API" width="593" height="459" /></a>
ZappySys ODBC Driver for XML / SOAP API</li>
 	<li>Configure API URL, Request Method and Request Body as below
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/calling-soap-web-service-zappysys-xml-driver.png"><img loading="lazy" decoding="async" class="size-full wp-image-3876" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-7.png" alt="ZappySys XML Driver - Calling SOAP API - Configure URL, Method, Body" width="916" height="874" /></a>
ZappySys XML Driver - Calling SOAP API - Configure URL, Method, Body</li>
 	<li><strong>(This step is Optional)</strong> If your SOAP API requires credentials then Select Connection Type to HTTP and configure as below.
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/soap-api-call-credential-basic-soap-wss-zappysys-xml-driver.png"><img loading="lazy" decoding="async" class="size-full wp-image-3877" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-8.png" alt="ZappySys XML Driver - Configure SOAP WSS Credentials or Basic Authorization (Userid, Password)" width="564" height="483" /></a>
<div style="display: block;">ZappySys XML Driver - Configure SOAP WSS Credentials or Basic Authorization (Userid, Password)</div></li>
 	<li>Configure-Request Headers as below (You can get it from Request &gt; Raw tab from SoapUI after you test the request by clicking the Play button)
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/set-soap-api-request-headers-zappysys-xml-driver.png"><img loading="lazy" decoding="async" class="size-full wp-image-3881" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-9.png" alt="Configure SOAP API Request Headers - ZappySys XML Driver" width="1009" height="747" /></a>
Configure SOAP API Request Headers - ZappySys XML Driver</li>
 	<li>Once credentials entered you can select Filter to extract data from the desired node. Make sure to select array node (see special icon) or select the node which contains all necessary columns if you don't have array node.
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/soap-api-query-select-filter-zappysys-xml-driver.png"><img loading="lazy" decoding="async" class="size-full wp-image-3882" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-10.png" alt="Select Filter - Extract data from nested XML / SOAP API Response (Denormalize Hierarchy)" width="809" height="594" /></a>
Select Filter - Extract data from nested XML / SOAP API Response (Denormalize Hierarchy)</li>
 	<li>If prompted select yes to treat selected node as Array (This is helpful when you expect one or more record for selected node)
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/xml-api-array-handling-zappysys-xml-driver.png"><img loading="lazy" decoding="async" class="size-full wp-image-3883" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-11.png" alt="Treat selected node as XML Array Option for SOAP API Response XML" width="655" height="572" /></a>
Treat selected node as XML Array Option for SOAP API Response XML</li>
</ol>
<h3>Preview SOAP API Response / Generate SQL Code for SOAP API Call</h3>
Once you configure settings for XML Driver now you can preview data or generate example code for desired language (e.g. C#, Python, Java, SQL Server).

Go to Preview tab and you will see default query generated based on settings you entered in previous sections. Attributes listed in WITH clause are optional. If you omit attribute in WITH clause it will use it from Properties tab.
<h3>Preview Data</h3>
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/calling-soap-web-service-zappysys-xml-api-driver.png"><img loading="lazy" decoding="async" class="size-full wp-image-3884" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-12.png" alt="Preview SOAP API Response in ZappySys XML Driver" width="808" height="780" /></a>
Preview SOAP API Response in ZappySys XML Driver
<h3>Generate Code Option</h3>
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/zappysys-driver-code-generator.png"><img loading="lazy" decoding="async" class="size-full wp-image-3885" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-13.png" alt="Generate Example Code for ZappySys Driver" width="572" height="618" /></a>
<div style="display: block;">Generate Example Code for ZappySys Driver</div></div>
<h2>Conclusion</h2>
<p>Tableau has no out of the box features to consume many Web API / JSON / XML data sources out there. ZappySys has developed most innovative drivers which can connect to virtually any REST API / SOAP data sources in Tableau. These drivers also capable reading local files in JSON / CSV or XML format. Feel free to download  <a href="https://zappysys.com/products/odbc-powerpack/">ZappySys Drivers here</a> and try yourself . You can always contact ZappySys Support Team <a href="https://zappysys.com/support/" target="_blank" rel="noopener">here</a> if you need any API integration help.</p>
<p>The post <a href="https://zappysys.com/blog/import-rest-api-tableau-read-json-soap-xml-csv/">Import REST API in Tableau &#8211; Read JSON, SOAP XML, CSV</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
