Uncaught ReferenceError: tableau is not defined

Uncaught ReferenceError: tableau is not defined

kishoreakishorea Posts: 2Questions: 1Answers: 0
edited July 2022 in Free community support

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

Answers

Sign In or Register to comment.