Uncaught ReferenceError: tableau is not defined
Uncaught ReferenceError: tableau is not defined
kishorea
Posts: 2Questions: 1Answers: 0
Hi,
I am getting Uncaught ReferenceError: tableau is not defined.
Please suggest.
Below is the code:
(function() {
// Create the connector object
var myConnector = tableau.makeConnector();
// Define the schema
myConnector.getSchema = function(schemaCallback) {
var cols = [{
id: "shipTo",
alias: "shipTo",
dataType: tableau.dataTypeEnum.string
}, {
id: "soldTo",
alias: "soldTo",
dataType: tableau.dataTypeEnum.string
}, {
id: "uid",
alias: "uid",
dataType: tableau.dataTypeEnum.string
}];
var tableSchema = {
id: "earthquakeFeed",
alias: "Order data",
columns: cols
};
schemaCallback([tableSchema]);
};
// Download the data
myConnector.getData = function(table, doneCallback) {
$.getJSON("*****************", function(resp) {
debugger;
var feat = resp.customers;
tableData = [];
// Iterate over the JSON object
for (var i = 0, len = feat.length; i < len; i++) {
tableData.push({
"shipTo": feat[i].shipTo,
"soldTo": feat[i].soldTo,
"uid": feat[i].uid
});
}
table.appendRows(tableData);
doneCallback();
});
};
tableau.registerConnector(myConnector);
// Create event listeners for when the user submits the form
$(document).ready(function() {
$("#submitButton").click(function() {
tableau.connectionName = "Order data"; // This will be the data source name in Tableau
tableau.submit(); // This sends the connector object to Tableau
});
});
})();
Edited by Kevin: Syntax highlighting. Details on how to highlight code using markdown can be found in this guide
This discussion has been closed.
Answers
Its hard to say specifically without seeing the page but I suspect the problem is that you are referencing the
tableau
variable but it is not accessible within the context of where the error is occurring. This doesn't look like a Datatables specific issue or question. However if you want help debugging please post a link to your page so we can take a look.Kevin
Hi Kevin..Thanks for responding..
We are trying to connect to API through webdataconnector from tableau
here is the html code and below is the error log in tableau
Storage>Cookies-and-see-more-details-at-https://www.chromestatus.com/feature/5088147346030592-and-https://www.chromestatus.com/feature/5633521622188032."}_____">Storage>Cookies-and-see-more-details-at-https://www.chromestatus.com/feature/5088147346030592-and-https://www.chromestatus.com/feature/5633521622188032."}_____" href="#_____{"ts":"2022-07-18T03:10:24.005","pid":27236,"tid":"6bb8","sev":"info","req":"-","sess":"-","site":"-","user":"-","k":"web-data-connector","v":"http://*****:8888/apitestWDC.html:0----A-cookie-associated-with-a-cross-site-resource-at-http://gateway.zscloud.net/-was-set-without-the-SameSite-attribute.-A-future-release-of-Chrome-will-only-deliver-cookies-with-cross-site-requests-if-they-are-set-with-SameSite=None-and-Secure.-You-can-review-cookies-in-developer-tools-under-Application>Storage>Cookies-and-see-more-details-at-https://www.chromestatus.com/feature/5088147346030592-and-https://www.chromestatus.com/feature/5633521622188032."}_____">_____{"ts":"2022-07-18T03:10:24.005","pid":27236,"tid":"6bb8","sev":"info","req":"-","sess":"-","site":"-","user":"-","k":"web-data-connector","v":"http://*****:8888/apitestWDC.html:0 -- A cookie associated with a cross-site resource at http://gateway.zscloud.net/ was set without the
SameSite
attribute. A future release of Chrome will only deliver cookies with cross-site requests if they are set withSameSite=None
andSecure
. You can review cookies in developer tools under Application>Storage>Cookies and see more details at https://www.chromestatus.com/feature/5088147346030592 and https://www.chromestatus.com/feature/5633521622188032."}_____HTML Code
<html>
<head>
<title>Order data</title>
<meta http-equiv="Cache-Control" content="no-store" />
</head>
<body>
<div class="container container-table">
<div class="row vertical-center-row">
<div class="text-center col-md-4 col-md-offset-4">
<button type = "button" id = "submitButton" class = "btn btn-success" style = "margin: 10px;">Get Orders Data!</button>
</div>
</div>
</div>
</body>
</html>
It just seems that the
tableau
variable is out of scope at that point. It doesn't seem like a DataTable issue so may be worth asking on Tableau specific forum, or Stackoverflow,Colin