5 Replies Latest reply on Aug 3, 2016 11:07 PM by Jan Benjamin Engracia

    Web Connector works fine in Simulator but getting NoPassword error in Tableau

    Richard Edwards

      Hi All,

       

      I have a web connector, which works wonderfully in the simulator. However when I run it in Tableau itself I get an odd error:

       

      "An error occured while communicating with data source 'webdata-direct.0c9ilh508wpd6210iclhh1eo0i8a'

       

      'More Details' shows the following: NoPassword

       

      And that's all I get.

       

      This is an Incremental connector, which works fine in the simulator as expected. I can't really share the URL as it contains sensitive data in the response, but below is the basic code for it:

       

      (function() {
            var myConnector = tableau.makeConnector();
            myConnector.init = function () {
              tableau.incrementalExtractColumn = "conversion_date";
              tableau.connectionName = "Cake Conversions";
              tableau.initCallback();
            }
      
      
            myConnector.getColumnHeaders = function ()
            {
              var fieldNames = [
                  "conversion_id",
                  //"request_session_id",
                  "click_request_session_id",
                  "click_id",
                  "conversion_date"
              ];
              var fieldTypes = ['int','int','int','datetime'];
              tableau.headersCallback(fieldNames, fieldTypes);
            }
      
      
            myConnector.getTableData = function (lastRecordNumber) {
              var lastId = lastRecordNumber || '2016-06-01T00:00:00';
              var data = [];
              var clicks = '';
      
      
              $.ajax({
                  url:'conversionData.php',
                  data: 'start='+lastId+'&api_key=<?=$_GET['api_key']?>',
                  success: function(resp){
                      clicks = JSON.parse(resp);
                      populateData(clicks,lastId, data);
                  }
              });
      
      
            };
      
      
            tableau.registerConnector(myConnector);
      
      
          })();
      
      
          populateData = function(clicks, lastId, data){
              for (var i = 0; i < clicks.length; i++) {
      
      
                  data.push({
                      "conversion_id": parseInt(clicks[i]['conversion_id']),
                      //"request_session_id": parseInt(clicks[i]['request_session_id']),
                      "click_request_session_id": parseInt(clicks[i]['click_request_session_id']),
                      "click_id": parseInt(clicks[i]['click_id']),
                      "conversion_date": clicks[i]['conversion_date']
                  });
              }
              tableau.dataCallback(data, lastId.toString(), false);
          }
      
      
          window.onload = function() {
              tableau.submit();
          };