4 Replies Latest reply on Jun 30, 2017 5:49 AM by JUDE XAVIER

    Data Refresh in Desktop with WDC Data Source


      Hi Team,


      I have build a WDC to extract data from a third party application and have currently hosted it locally in my machine. The .html for the WDC has just a button to complete UI phase. And once we click button all the schema defined in WDC gets loaded into Tableau Desktop and we can drag any of them and start building the dashboard. This all works fine as expected. The issue I am facing is when I want to refresh. When I hit Refresh (from Data Menu) or Data Pane or even Edit the Data Source connection and reload the WDC UI page, I don't see the data being refreshed. The workbook still persists with the initial data that was extracted the first time. I can see this change only if I make any changes to the schema i have pulled in. I mean the refresh happens when add or remove tables to my workbook data.


      Has anyone had this kind of issue with data refresh when using WDC. How can we over come this issue?


      Any thought/advice would be helpful.





      PS: All this is in the local desktop environment and has nothing to do with the refreshing from Tableau Server. We have not published anything to server yet.

        • 1. Re: Data Refresh in Desktop with WDC Data Source

          Hey Jude,


          Would you be able to share your WDC code so others can take a look?





          • 2. Re: Data Refresh in Desktop with WDC Data Source
            Ed is Awesome Bynum

            I don't know if Jude is available to share his WDC, but I can. I have removed a lot of lines (of unnecessary stuff that isn't related, including confirming that nothing changes as a result).

            (function () {     var myConnector = tableau.makeConnector();      myConnector.getSchema = function (schemaCallback) {         var surveyCols = [             { id: "id", alias: "Master ID", dataType: tableau.dataTypeEnum.int },             { id: "survey_number", alias: "Survey Number", dataType: tableau.dataTypeEnum.int }         ];          var surveyTable = {             id : "Survey_Data",             alias : "Surveys",             columns : surveyCols,             incrementalColumnId : "id"         };          schemaCallback([surveyTable]);     };      myConnector.getData = function(table, doneCallback) {         var tableData = [];                  if(table.tableInfo.id == 'Survey_Data') {             var lastId = parseInt(table.incrementValue || -1);              $.getJSON("/api/surveys/" + lastId, function(response) {                 var surveys = response.surveys;                  // Iterate over the JSON object                 for (var i = 0, len = surveys.length; i < len; i++) {                     var survey = surveys[i];                     tableData.push({                         "id": survey["id"] ? survey["id"] : null,                         "survey_number": survey["survey_number"],                     });                 }                  table.appendRows(tableData);                 doneCallback();             });         }     };      tableau.registerConnector(myConnector);      myConnector.init = function(initCallback) {         initCallback();         tableau.connectionName = "Survey WDC";         tableau.submit();     }; })();

            I don't know that Jude is experiencing exactly the same issue (though I would guess he is), but to make sure that I'm clear about my issue.

            1. The issue occurred in 10.2 and 10.3. I haven't tried in (or used) anything else.
            2. The issue occurred both before and after adding the incrementalColumnId.
            3. To demonstrate the issue:
              1. Create new workbook in Tableau 10.3.
              2. Connect to the WDC.
              3. Switch to Sheet 1 tab, which creates Extract of WDC data. [Note: the datetime of the extract appears in the top left corner of the data source panel.]
              4. [do anything I can think of to cause the data to be updatd]
              5. It isn't.


            So. Am I missing something?

            1. I've tried "Refresh Data Source" which doesn't hit tableauConnector.getData at all. This seems to simply refresh the sample data that shows in the preview pane at the bottom right (from the extract).
            2. I've tried "Edit Connection", which simply pops up the connection window which then auto-closes (because there's no user interaction required). This also doesn't hit the connector's getData method.
            3. If I make a change to the schema defined in the WDC, the next time I try either of the above (Refresh Data Source or Edit Connection), it does reload everything (ignoring, reasonably, the previously loaded ID).
            4. That process also changes the display, indicating that there is no longer an extract (presumably, the extract was invalidated by the new schema).

            I guess that's all I've got.

            • 3. Re: Data Refresh in Desktop with WDC Data Source
              Ed is Awesome Bynum

              So I think (while working on other things) I found the solution to this. At least, the solution to my part of it, I think ...


              To refresh the extract from the WDC, follow steps 3.1, 3.2, and 3.3 above.

              3.1) Create new workbook in Tableau 10.3.

              3.2) Connect to the WDC.

              3.3) Switch to Sheet 1 tab, which creates Extract of WDC data. [Note: the datetime of the extract appears in the top left corner of the data source panel.]


              From the [Sheet 1] tab (or any other worksheet tab), right click on your WDC in the Data pane at the top left. Go down to Extract, and you should have options for

              Refresh (Incremental) [if you have it set up]

              Refresh (Full)


              which should do what you (and I) were trying to do.    

              1 of 1 people found this helpful
              • 4. Re: Data Refresh in Desktop with WDC Data Source
                JUDE XAVIER

                Hi Ed,


                Thanks for your reply. Yes you are absolutely correct with this approach. I stumbled upon this solution when I was working with the XLS data extract as the source. So in general when we use extracts, what Tableau does is, it creates a copy of our data. So if we want to refresh the data present in the extract we would have to refresh the extract (3.3 step). It actually makes sense but just that it was not mentioned anywhere in the context of an WDC data extract.


                Thanks for your time and response. I will close this question as answered.