1 Reply Latest reply on Jun 11, 2018 2:24 PM by patrick.byrne.0

    Web Data Connector Debug

    solomonteo.how

      I'm trying to append 3 tables data into one table while using WDC.

       

          // Download the data

          myConnector.getData = function(table, doneCallback) {

              var arrayList = ['server1', 'server2', 'server3'];

              var d = new Date();

              d.setUTCDate(d.getUTCDate());

              var endTime = d.getTime();

              d.setUTCDate(d.getUTCDate() - 6);

              var startTime = d.getTime();

         

              for (var arrayCount in arrayList) {

                  dateString = "startTime=" + startTime + "&endTime=" + endTime,

                  apiCall = "URL" + arrayList[arrayCount] + "?&" + dateString + "&something";

                  $.getJSON(apiCall, function(resp) {

                      var feat = resp.reports["0"].reportData,

                          tableData = [];

                      // Iterate over the JSON object

                      for (var i = 0, len = feat.length; i < len; i++) {

                          tableData.push({

                              "DB_X": feat[i].something["DB_X"].value,

                              "DB_Y": feat[i].something["DB_Y"].value,

                              and so on

                          });

                      }

                      table.appendRows(tableData);

                      doneCallback();

                  });

              }

          };

       

      It works perfectly on simulator, i can get the 3 tables information. But it only show 1 table on tableau desktop. Any reason why? I could't debug on my com as i'm using mac and tableau desktop debugging only works on windows.

       

      I suspect it's the donecallback being called too early but tried shifting around and it's not working.