26
SEP
2019

Write Back Extensions – 3 in 1 Quickstart

Tags :
Kommentare : 73

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?

    • Timo Tautenhahn
      Timo Tautenhahn Reply

      Hi Nihar,
      YES, you can trigger an Alteryx workflow via API and therefore the scenario you described would be possible

  23. Avatar
    Ricardo Reply

    Hi Nihar,

    Writing to Alteryx Server should be done indirectly by first writing to a DB like AWS Redshift and then reading that data with an Alteryx input.

    If you don’t want to build the extension on your own and take advantage of more advanced features you can check https://writeback4t.com/ a commercial Tableau extension built by Xpand IT that provides OOTB write back to Redshift among others DBs.

  24. Avatar
    chakith Reply

    Hi team,

    Thanks for providing this extension.

    writeback comments on Tableau desktop was working but changes not showing on desktop, could you please let us know where the comments are getting saved and why are they not reflecting on desktop? 

    • Timo Tautenhahn
      Timo Tautenhahn Reply

      Hi Chakith,
      The comment do get written into a MySQL database for this example. If you hit F5 twice after you’ve been selecting the sheet which does show the comments, does this show you the comments you’ve been entering?

      • Avatar
        chakith Reply

        Hi Timo,

        Thanks for your response.

        We tried refreshing it twice but still no comments are visible.

        Check this screenshot: https://drive.google.com/file/d/1B0X1jMe5W0VL6YzMZwrfepfDar7tSR9b/view

        We selected a circle and gave a comment input. After refreshing, it doesn’t seem to show my comment in the top right box.

        Let us know if we are doing anything wrong.

        • Timo Tautenhahn
          Timo Tautenhahn Reply

          You‘re welcome! The screenshot shows a statement within the extension which says „Choose 1 sheet from“. This shouldn‘t be visible after one has got selected which sheet to listen to (for selections). Therefore I assume that the JavaScript code doesn‘t know what you‘ve been selecting and therefore can‘t write sth into the database. Just follow the steps within the troubleshooting section.

          • Avatar
            chakith

            Thanks a lot Timo! It works!

  25. Avatar
    Matthias Reply

    Hi Timo,
    thanks alot for this great extension! We’re using it succefully for several months, then updatet our Server to Linux. No the extension is working only for the admin-role, no longer for viewer or explorer roles.
    Someone else experienced this issue?
    Regards, Matthias

    • Timo Tautenhahn
      Timo Tautenhahn Reply

      Hi Matthias,
      this sounds like more of a general Tableau Extension / OS / Upgrade issue. I haven’t experienced this, yet. Could you please ask this question in the Tableau Community Dev by adding the versions to your ask?

      Thank you very much!

  26. Avatar
    Uday Reply

    Hello,

    I’m trying to configure write-back API on one of our tableau server, but struck at some point where adding writeback URL to tableau server, it would be really helpful if you provide me some insight on fixing this issue.

    Thanks,
    Uday Reddy

  27. Avatar
    Ron L Reply

    Hi,

    Where in your tableau code should I change the php port from 8888 to whatever I set it in xampp? I can’t use port 8888 for some reason so I changed it to 8889 but I get this error when I open tableau (inside the extension window):
    Where in your code should I change the php port from 8888? I had to change it in xampp but now I get an error:
    Requested URL http://localhost:8888/extensions-api-master/myExtensions/Tableaufans-WriteBack-Extension/index.html

    Physical Path C:\inetpub\wwwroot\extensions-api-master\myExtensions\Tableaufans-WriteBack-Extension\index.html

    • Timo Tautenhahn
      Timo Tautenhahn Reply

      Please check the TREX file for the port

  28. Avatar
    sravan Reply

    Hi Timo

    I downloaded extensions-api-master but I could not find my extensions or any trex files

    • Timo Tautenhahn
      Timo Tautenhahn Reply

      The folder myExtensions should exist within the large download file. How many MB did you download?

      You should find the TREX in a ZIP file within the last tab of this blog post

  29. Avatar
    Anil Reply

    Hi Timo,

    Am unable to download TREX files from above link. Can you please share it here?

    • Timo Tautenhahn
      Timo Tautenhahn Reply

      You should find it in a ZIP file within the last tab of this blog post

  30. Pingback: Tableau Write Back to Database | Write Back Tableau - Question Answer

  31. Avatar
    Carl Reply

    Can this be a sandboxed extension or does it need to be a network enabled extension? Thanks

    • Timo Tautenhahn
      Timo Tautenhahn Reply

      Hi Carl,
      It could be a sandboxed extension. You just need to package the external libraries I‘m using in the example above and you‘d be good to go.

  32. Avatar
    Akash Jain Reply

    Hi Timo,

    Great Work, you have solved a big problem of mine.
    I am trying to access the Writeback Worksheet getting below error, entered “admin” as password
    “An error occurred while communicating with MySQL
    Invalid username or password.
    Error Code: DAFFF161
    [MySQL][ODBC 8.0(w) Driver]Access denied for user ‘admin’@’localhost’ (using password: YES)
    Invalid username or password.”

    • Timo Tautenhahn
      Timo Tautenhahn Reply

      Glad to hear! Invalid username/PW errors are usually the easiest ones. Just try admin/admin for this asset

  33. Avatar
    Marek Cernansky Reply

    Hi Timo, this is great Extension. We really appreciate you amazing work.
    We would like to use it for on-the-fly Forecasting editing (“classic approach 🙂 on the server.

    Before implementing it on Tableau server 2022 we are trying to test it on local laptops using Win 10 Pro, Tableau 2022.2 and MySQL 8 / MsSQL Server 2017

    However after downloading I started .exe file as discribed in steps, but when opened Workbook it was not possible to login into MySQL.

    admin/admin is not working.
    When I open Workbench I can get into root, see the MySQL server running. Testing dbs I have, but not able to locate “tableaufans”. Not sure what I am doing wrong.

    Last issue is 8888 port is already taken so Apache is showing in command line:

    “Diese Eingabeforderung nicht waehrend des Running beenden
    Bitte erst bei einem gewollten Shutdown schliessen
    Please close this command only for Shutdown
    Apache 2 is starting …
    (OS 10048)Normßlný je povoleno pouze jedno pou×itÝ ka×dÚ adresy (protokolu, sÝŁovÚ adresy, portu) soketu. : AH00072: make_sock: could not bind to address [::]:8888
    (OS 10048)Normßlný je povoleno pouze jedno pou×itÝ ka×dÚ adresy (protokolu, sÝŁovÚ adresy, portu) soketu. : AH00072: make_sock: could not bind to address 0.0.0.0:8888
    AH00451: no listening sockets available, shutting down
    AH00015: Unable to open logs

    Apache konnte nicht gestartet werden”

    Thank you very much for any advice.
    Greeting from Slovakia

    • Timo Tautenhahn
      Timo Tautenhahn Reply

      Hi Marek, it sounds like there is just one issue which causes all of it which is port 8888. Please try it on a machine/VM where this port is not being used.

  34. Pingback: Tableau Write Back to Database Extensions | Write Back Tableau - Question Answer

  35. Avatar
    Arslan Reply

    Following all the steps, but submit button is not inserting values in the database.
    Moreover, I am getting error in MarkSelection.js.

    • Timo Tautenhahn
      Timo Tautenhahn Reply

      What is the exact error message you’re getting?

Kommentare

*

captcha *