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.shipTo,
"soldTo": feat.soldTo,
"uid": feat.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
});
});
})();
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.shipTo,
"soldTo": feat.soldTo,
"uid": feat.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
});
});
})();