26
SEP
2019

Write Back Extensions – 3 in 1 Quickstart

Tags :
Kommentare : 46

In this blog post you can get all 3 Tableau Write Back Extensions as part of a larger demo asset – a Tableau Server Site which demonstrates all kinds of cool things on the Tableau Platform. Nevertheless people are regularly asking how to just quickly demonstrate how Tableau Write Back capabilities can look like. So this blog post is just about how to get the 3 Tableau Workbooks from above which include (Write Back Extensions) up and running as fast as possible?!

How can I get it?

Demo

Demo

System Requirements:

  • Windows operating system
  • Port 8888  needs to be open/free (Webserver)
  • Port 3306 needs to be open/free (MySQL)
  • Tableau Server 2018.3 or above

 

 

Step-by-Step Installation

Step-by-Step Installation

    1. Download this customized XAMPP 
      • Port 8888  needs to be open & free (Webserver)
      • Port 3306 needs to be open & free (MySQL)
    2. Extract it into C:
    3. Start the xampp_start.exe within C:\xampp-tableaufans
    4. Download and open the Tableau Workbooks
    5. Database password is “admin

Troubleshooting

  • Troubleshooting

    • Port 8888  is already in use before starting Xampp
      (Change the port)
    • Port 3306 is already in use before starting Xampp
      (Change the port)
    • You’re using an older Tableau Version than 2018.3.x
      • Download and install Tableau Desktop 2018.3.x or above
      • Open up the workbooks from step 4
      • Go to File > Export As and select the version that you want to downgrade to  
      • Keep in mind that the version needs to support Tableau Extensions. Therefore 2018.2 or above is required

     

    • If it’s still not working see how you can debug Tableau Extensions generally

      Files from the Video:
      1. Download Chromium
      2. Start Tableau Desktop 2018.3 (with Extension in Debug Mode)

FYI

P.S. Database User/Password are both “admin/admin” for all examples where workbooks leverage the MySQL database on Xampp you’ve been downloading above. You can have a look at the tables being used via http://localhost:8888/phpmyadmin/db_structure.php?server=1&db=tableaufans

 

 

Please let us know if this has been helpful and what kind of scenarios you’re looking forward to solve with it.

TREX Files

 

 

Timo Tautenhahn
Über den Autor
Timo originally coded his own BI-application by making use of different JAVA libraries. He Worked for IBM as BI-specialist and BA-architect before he joined Tableau. Favorite subject: JavaScript API
  1. Pingback: tableaufans.com » Tableau Write Back Extensions

  2. Pingback: tableaufans.com » Tableau Extension API – Write Back – Source Code

  3. Pingback: tableaufans.com » Tableau Extension API – Write Back – Updated Source Code for Tableau 2018.2

  4. Avatar
    Omar Reply

    Hello Timo,

    Appreciate this documentation and walkthrough for the writeback extension! I’m looking to set up this extension to write back to MS SQL or Teradata. Are there any possible negative consequences are setting up part of this writeback extension, other than a warning that something was set up wrong (eg. database corruption, etc)?

    Omar

    • Timo Tautenhahn
      Timo Tautenhahn Reply

      Hi Omar,
      you’re welcome and please feel free to adjust it to your own needs!!! You can absolutely adjust the Extensions to write data back to your backend of choice! I unified/adjusted the original table names a little bit for this blog post, but for MSSQL you can have a look at the steps necessary in this post “Write back to MSSQL Server

  5. Avatar
    Benoit Reply

    Hello Timo,

    Thank you very much for your work!
    I am looking to write back data to an Excel spreadsheet (locally hosted).
    Would it be possible to use the Write Back extension to do so? I guess it should be pretty simple but I can’t find a way.

    Best Regard,

    Benoit

    • Timo Tautenhahn
      Timo Tautenhahn Reply

      Hi Benoit,
      that is absolutely possible. You could adjust the “writeToDb.php” file within htdocs\extensions-api-master\myExtensions\Tableaufans--Extension\php. One library I just found within my first Google result was the following one: https://github.com/PHPOffice/PhpSpreadsheet. Please feel free to choose from many others out there. It would be awesome if you could keep the community posted about your approach! 😉

      • Avatar
        Benoit Reply

        Thank you very much for your informative (and quick) answer, I will try that and keep you posted!

      • Avatar
        Alex Leung Reply

        HI Timo,

        I am having trouble changing the “writeToDb.php”.

        Please can you give further guidance on it?

        Thank you.

        • Timo Tautenhahn
          Timo Tautenhahn Reply

          Hi Alex,
          what kind of trouble do you have?

  6. Avatar
    Max Henrion Reply

    Timo, these write-backs look great! Would you be available for some consulting to assist us with a modification to the extension? If not, can you suggest someone else?
    Thanks
    Max

    • Timo Tautenhahn
      Timo Tautenhahn Reply

      Max, I can highly advise you to reach out to a Tableau partner for this type of customization. Check out this list and find one in your region. You can also reach out to your Tableau seller directly so that he can help you find one.

  7. Avatar
    FT Reply

    Hi Timo,

    I have some problems when i open the extension in 2019.2 it crashes…
    When i look at the xampp in the embedding there is no writeback folder..
    If i open http://localhost:8888/TableaufansDemoOverview/ and click on writeback i get url like this but there nothing there: http://localhost/t/tableaufans/views/TableaufansWriteBackExtension/WriteBack
    Need a update i think?

    Best

    • Timo Tautenhahn
      Timo Tautenhahn Reply

      Hi FT,

      The workbooks within the demo are created with 2019.3. Attached you find one of it as v2019.1 workbook in order to be able to test it: DOWNLOAD If it works I’m happy to provide you with the other workbooks, too since this is very easy to achieve.

      The write back code is located deeper in the folder structure: “xampp-tableaufans\htdocs\extensions-api-master\myExtensions\Tableaufans-WriteBack-Extension\php\writeToDb.php”

      The XAMPP for this blog post is just being used to host the database + webserver. Therefore don’t open up the browser, but open up the workbooks instead. (I’ve been updating the XAMPP anyway to make this page not even appear for this asset anymore)

      The link works if you setup this site on your local Tableau Server

      Cheers,
      Timo

  8. Avatar
    Simone Magagnini Reply

    This is awesome but it doesnt work…perhaps the issues with the IT ppl 🙁

    • Timo Tautenhahn
      Timo Tautenhahn Reply

      Hey Simone, What exactly is not working?

  9. Avatar
    Anuj Reply

    Hey Timo, this wsa working earlier and now it seems to stop working.. its not doing anything after you select the Mark.
    i tried debugging but didnt make much headway. i even download a fresh copy from the web and saw the same thing..
    function loadSelectedMarks
    console.log(“worksheetName:” + worksheet.name );
    // Call to get the selected marks for our sheet
    worksheet.getSelectedMarksAsync().then(function (marks) {
    // Get the first DataTable for our selected marks (usually there is just one)
    const worksheetData = marks.data[0];
    // console.log(“in loadSelectedMarks”);
    //console.log(“worksheetData :” + worksheetData);
    // console.log(“totalRowCount :” + marks.data[0].totalRowCount);

    // Map our data into the format which the data table component expects it
    const data = worksheetData.data.map(function (row, index) {
    const rowData = row.map(function (cell) {
    //selected marks per row and index (= column)
    return cell.formattedValue;
    });
    console.log(“rowData:” + rowData);
    print(“rowData:” + rowData);

    it doesnt print any data in the console log

  10. Avatar
    Wannie W Reply

    Hi Timo,
    Thank you for sharing such an awesome tool!
    Is there any way for the extension to connect to Oracle Database instead of MySQL? If so, what are the configuration changes?

    • Timo Tautenhahn
      Timo Tautenhahn Reply

      Hi Wannie,
      thank you very much for your feedback and you’re welcome! 😉

      Absolutely! Just look at the following posts which describe what you need to adjust to write data to MS SQL, SAP HANA or Snowflake and make similiar adjustments to write data back to Oracle.

      Snowflake
      MS SQL
      SAP HANA

      If you want to contribute your work back to the community I’m happy to let you post about it once you’ve successfully set it up.

  11. Avatar
    Hema Reply

    Hi Timo,
    Thanks a ton for sharing this!! Can we use Teradata for this? Also, can we host the extension on our internal server?
    Thanks!
    Hema.

    • Timo Tautenhahn
      Timo Tautenhahn Reply

      Hi Hema,
      2x absolutely yes.

      1) Teradata: Just have a look at the last comment above yours.
      2) Host on internal Server: Yes. You just need a normal web server for it. You can theoretically use Tableau’s built in web server (NOT SUPPORTED!), but also any other one.

  12. Avatar
    Matt Reply

    Hi Timo:

    We upgraded our QA Tableau Server to 1019.4.3. However, now the writeback functionality no longer works. Anuj’s post from January 7th sounds like the exact issue we’re having because it’s failing in the same place. Using “Alerts” I was able to pinpoint where the issue is:

    const data = worksheetData.data.map(function (row, index) {
    const rowData = row.map(function (cell) {
    //selected marks per row and index (= column)
    return cell.formattedValue;
    });

    Any thoughts?

    • Timo Tautenhahn
      Timo Tautenhahn Reply

      Hi Matt,
      Does it work for Tableau Desktop locally?
      And in case the Extension is not running locally, did you setup HTTPS between Tableau Server and the Extension Web Server?

  13. Avatar
    Mohan Reply

    Hello Timo,

    I have followed your instructions but when i opened the workbook and enter the password as admin, the “Sign In” is still grayed out and not actcivated. I am using 2019.3 desktop version.

    Any help is appreciated.

    -Mohan

    • Timo Tautenhahn
      Timo Tautenhahn Reply

      Hi Mohan,
      could you please try to connect to the MySQL database in an empty workbook?

      • Avatar
        Mohan Reply

        Thank you for your reply.
        Yes, It works when I try to connect from an empty workbook. we have a few dashboards that run on my SQL. The samples are the only ones I am not able to open.

        -Mohan

        • Timo Tautenhahn
          Timo Tautenhahn Reply

          Hey Mohan,
          you might want to have a look at the latest comment from Matt. He realized a change within the naming convention of Tableau’s Extension API.

  14. Avatar
    Raj Reply

    Hi Timo,
    This is a great blog, I followed the all steps to test out the extension. However for some reason when I add the extension to the dashboard it isn’t working. I’m getting the texts displayed but i’m not able to interact with the extension. It’ll be really helpful if you can guide me on this !

    • Timo Tautenhahn
      Timo Tautenhahn Reply

      Hi Raj,
      2 questions:

      1. Did you use my pre-built dashboards which already contain the extension?
      2. Did you follow the Troubleshooting tab video?

      • Avatar
        Raj Reply

        Thanks for your reply Timo,

        The extension works fine with your latest version, where all the steps are automated. However I was trying the manual setup process where the extension interface is failing.

        I was trying manual process because it’ll help me understand underlying steps better, as I’ll have to tweak the scripts and eventually want the extension to write back on HANA DB.

  15. Avatar
    Matt Reply

    Hi Timo:
    Thanks for getting back to me. It does not work within desktop either. Yes the https is setup between the Tableau server and the extension server. This functionality has been working under 2018.3.1 since April. It still works today and is used in existing dashboards, again under 2018.3.1.

  16. Avatar
    Matt Reply

    I came across this known issue in 2019.4.3:
    1052015 TABLEAU DESKTOP, TABLEAU SERVER
    In Rest Api Schema, Public schemas missing attributes for viewType and siteType.

    FIXED IN 2019.2.9, 2019.2.9, 2019.3.5, 2019.3.5, 2019.4.4, 2019.4.4

    Let me install 2019.4.4 and see if I have better luck.

  17. Avatar
    Matt Reply

    Okay, it didn’t work in Tableau Desktop 2019.4.4 either. Looks like the same issue. I’m having trouble getting the dashboard into debug mode. I went ahead and used alerts to track to the point of failure which is occuring in the loadSelectedMark function:

    In the below source, I receive the “Load Title” and the “Row Data1 alerts, but never make it to the “Row Data2” or “Row Data3” alerts:

    function loadSelectedMarks (worksheetName) {

    // Remove any existing event listeners
    if (unregisterEventHandlerFunction) {
    unregisterEventHandlerFunction();
    }

    // Get the worksheet object we want to get the selected marks for
    const worksheet = getSelectedSheet(worksheetName);
    alert(‘Load Title’);
    // Set our title to an appropriate value
    $(‘#selected_marks_title’).text(worksheet.name);

    // Call to get the selected marks for our sheet
    worksheet.getSelectedMarksAsync().then(function (marks) {
    // Get the first DataTable for our selected marks (usually there is just one)
    const worksheetData = marks.data[0];
    // Map our data into the format which the data table component expects it
    alert(‘Row Data1’);
    const data = worksheetData.data.map(function (row, index) {
    alert(‘Row Data2’);
    const rowData = row.map(function (cell) {
    //selected marks per row and index (= column)
    alert(‘Row Data3’);
    return cell.formattedValue;

    });

    return rowData;

    });

    • Avatar
      Matt Reply

      Here is our tableau extensions library include:

      • Avatar
        Matt Reply

    • Avatar
      Matt Reply

      Hi Timo:

      We figured it out. I had to go back and download the latest version of the Tableau Extension Library – And replace the “lib” folder on our site with the new one from git. The naming convention changed from tableau-extensions-1.latest.js to tableau.extensions.1.latest.js. So we’re good.

      • Timo Tautenhahn
        Timo Tautenhahn Reply

        AWESOME Matt!!! Thx a lot for sharing this resolution!!!

  18. Avatar
    Matt Reply

    “lib/tableau-extensions-1.latest.js”

  19. Avatar
    Redona Reply

    Hello, I was able to follow all the described steps and open the demo workbooks. But I am wondering how can I use this extensions with another Workbook I have created. I cannot find any .trex files, which are the only ones that can be selected when an extension is added to a dashboard.
    Thank you in advance

    • Timo Tautenhahn
      Timo Tautenhahn Reply

      Hi Radona,
      sure, here we go: TREX Files

      • Avatar
        Redona Reply

        Thank you 🙂

  20. Avatar
    Akash Lamba Reply

    Hi Timo,

    Thanks for your wonderful blog. I am facing a issue while dropping the write back extension on my tableau dashboard. The error which I am getting is Error 404 – Object not found error. please see it below :

    The requested URL was not found on the server. The link on the reffering page seems to be wrong or outdated.

    Can you please help to resolve the above mentioned issue. Thanks for your time.

    Regards,
    Akash Lamba

    • Timo Tautenhahn
      Timo Tautenhahn Reply

      Hi Akash,
      thank you very much for your kind words!!! Are you using the TREX files which I just uploaded or the dashboards which do have the Extension built in? In both ways the Extension points to the following path:

      http: //localhost:8888/extensions-api-master/myExtensions/Tableaufans-WriteBack-Extension/index.html. This means the Xampp I put into this blog post needs to be up and running and within the htdocs folder within Xampp there needs to exist this file within this exact path: extensions-api-master/myExtensions/Tableaufans-WriteBack-Extension/index.html

      Please let me know if this is the case and if this works fine.
      TT

  21. Avatar
    Akash Lamba Reply

    Hi Timo,

    Thanks for your quick response. Yes I am using the latest TREX files which are uploaded by you.Also, I am using the exact path of the extension in htdocs folders. My Xampp is up and running. but still when I use the extension on your dashboard I get the same error which I described in my previous query.

    I would really appreciate if you can help me out with this. Thanks for your time.

    Regards,
    Akash Lamba

  22. Avatar
    Nihar Reply

    Hello Timo,

    Thanks for sharing this cool feature. Will the write back work with Alteryx server and AWS redshift? If possible, can you please let me know on how to write back to Alteryx server and AWS redshift?

Kommentare

*

captcha *