19
SEP
2018

Tableau Extension API – Write Back – Updated Source Code for Tableau 2018.2

Kommentare : 35

Due to the Google Analytics analysis I’ve done for the current quarter one can easily see that you – the Tableau community which we call “Tableaufans” – have been asking for more write back content. Would you agree?

So as a very first step I’m going to attach a quick tutorial around how to get “Tableaufans-WriteBack-2018.2” up and running for Tableau’s latest release (2018.2) and above. If you haven’t heard about “Tableaufans.com’s Write Back Extension” yet, you might want to watch the ~4min video from one of the previous posts to understand what you could get by following these steps.

  1. In order to be able to leverage the write back extension you need to have a webserver and a MySQL database
    1. I’m using XAMPP version 7.0.23 which contains both. You can download it here.
    2. Once you’re done downloading it you can extract the folder directly into C:
      (By copying it directly into C: it would simply allow you to follow all of my tutorials around extensions and JS API just a little bit easier in the future.)
    3. Start “C:\xampp\xampp_start.exe” as administrator
  2. Download the latest extension-api-master here: https://github.com/tableau/extensions-api
  3. Extract the content and paste it into your webserver (C:\xampp\htdocs)
  4. Extract the zip below and create a new file path where you extract it’s content into:
    Tableaufans-WriteBack-2018.2.ServerLogic(HTML,PHP,JS,CSS,)
  5. Extract the *.trex file and copy it into C:\Users\<USERNAME>\Documents\My Tableau Repository\Extensions
    Tableaufans-WriteBack-2018.2
  6. Make sure your XAMPP (Webserver+MySQL database) is up and running
    1. Apache should use port 8888
    2. Mysql 3306
      -> (If this is not the case, please change your ports accordingly as it will help you to use more assets from Tableaufans.com in the near future)
  1. MySQL should have a database called ‘yoursqldb’ with a table ‘getdataandwriteback’:
    (if not, please use ‘yoursqldb.sql’ attached to create the table within a database called ‘yoursqldb’)
  2. Add a new user to MySql (direct link to the right user interface on MySql)
    1. User name: admin
    2. Host name: localhost
    3. Password: admin
    4. Re-type: admin
    5. Privileges: Data, Structure & Administration
  3. Extract and Open “Tableaufans-WriteBack-2018.2.twbx.zip” with Tableau Desktop
  4. Drag and drop extension into the canvas and choose the one you copied into C:\Users\<USERNAME>\Documents\My Tableau Repository\Extensions
  5. Allow data access to the extension:
  6. Choose “Pipeline” as sheet to choose data selections from:
  7. Happy write back your data 😉

 

 

Troubleshooting:

  • If the data doesn’t get written into the database make sure that you’ve got a user called “admin” in MySQL with password “admin” with the following permissions:
    • http://localhost:8888/phpmyadmin/server_privileges.php?db=&viewing_mode=server
    • http://localhost:8888/phpmyadmin/server_privileges.php?username=admin&hostname=localhost&dbname=&tablename=&routinename=
  • If you want to debug Tableau Extensions generally you might want to have a look the following 2:21 min tutorial

    Start Tableau Desktop (with Extension in Debug Mode).bat
  • If you’re having any troubles in getting the extension up and running please leave us a comment below.
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. Timo Tautenhahn
    Timo Tautenhahn Reply

    Hey Tableaufans,
    I’ve just updated the tutorial. ! In the alpha version of Tableau’s Extensions I’ve been zipping my whole Xampp where the admin user did already exist. As this tutorial should work for everyone I’ve extended this post by describing how to create the admin user.

  2. Adrien Reply

    Hi Timo,

    We met a week ago and you showed us this capability. It is brilliant, I followed all the steps but at the moment, we use tableau 10.5. is there any limitation to use tableau extension? Which version do I need? if not, could you share the tableau workbook in previous version?

    thanks for your help
    Adrien

  3. Pingback: » Tableau Extension API – Write Back

  4. Sam Reply

    Hi Timo
    We use 10.5 as of now on my complany server but I have 2018 installed on my local machine,
    Would it be possible to install the writeback for me on my local machine with above steps ??

    • Timo Tautenhahn
      Timo Tautenhahn Reply

      Hey Sam,
      yes, if you’re using Tableau Desktop 2018.2 or above you can absolutely use it locally with the steps above! 😉

  5. Francisco Reply

    Hi Timo,

    Awesome post! Thanks for putting this together 🙂

    I have mySQL and WebServer installed remotely on a VM. Everything is set up. I modified the trex file by replacing ‘localhost’ with my VM’s IP address but I’m getting the following error when adding the extension:

    Unable to complete action
    Error parsing extension manifest :
    Error(10,66): value ‘http://192.168.0.18:8888/myExtensions/index.html’ does not match regular expression facet ‘[Hh][Tt][Tt][Pp][Ss]://.+|[Hh][Tt][Tt][Pp]://[Ll][Oo][Cc][Aa][Ll][Hh][Oo][Ss][Tt]|[Hh][Tt][Tt][Pp]://[Ll][Oo][Cc][Aa][Ll][Hh][Oo][Ss][Tt][:/].*’ (id: )

    I’m not sure how to solve this issue. Could you help me?

    • Timo Tautenhahn
      Timo Tautenhahn Reply

      Hey Francisco,
      Did the connection with the local My SQL work? Please ensure this first.

      Secondly try to ping the VM from the machine you‘re running the app on and make sure firewalls aren’t blocking you.

      Last but not least please ensure you‘re having the same database encoding I setup for this app.

      Please keep the community updated,
      Timo

    • Matt Fette Reply

      Hi Francisco:

      We are having the same issue. Were you able to resolve your issue? If so, what was the cause.

      Thanks, Matt

  6. Matt Fette Reply

    Hi Timo:

    Very nice. Would you be able to modify it to use a SQL Server database rather than a MySQL database?

    Thanks, Matt

    • Timo Tautenhahn
      Timo Tautenhahn Reply

      Hi Matt,
      yes, absolutely! Simply navigate to the following folder C:/xampp/htdocs/Tableaufans-Commenting-Extension/php and find the ~writeBack.php file. If you‘ve installed the drivers for other databases simply change the connection here.

      You might need to install additional PHP libraries to establish the connection.

      Please let me know if this worked for you.

      Cheers,
      Timo

      • Matt Fette Reply

        Hi Timo:

        I altered your MySQL script to create the tables in a DB called yoursqldb in MS SQL Server. However, in the Tableaufans-WriteBack-2018.2 workbook, your data sources don’t match with the tables created by the script or the tables shown in your documentation.
        Workbook Data Sources:
        DatasourceMySQL
        SuperstoreEurope (Only)
        writeBackTableOnly

        Tables created by provided/attached MySQL script:
        getdataandwriteback
        superstoreeurope

        Is there an update to the documentation or am I missing something?

        Thanks, Matt

  7. Matt Fette Reply

    Hi Timo:

    We have the figured out our issue with the data sources and that’s okay now. However, like Francisco above, we are in a VM environment and the database server is separate from the Tableau server:

    Unable to complete action
    Error parsing extension manifest :
    Error(10,128): value ‘http://1qvbidb01.ourcompany.com:8888/extensions-api-master/myExtensions/Tableaufans-WriteBack-2018.2/index.html’ does not match regular expression facet ‘[Hh][Tt][Tt][Pp][Ss]://.+|[Hh][Tt][Tt][Pp]://[Ll][Oo][Cc][Aa][Ll][Hh][Oo][Ss][Tt]|[Hh][Tt][Tt][Pp]://[Ll][Oo][Cc][Aa][Ll][Hh][Oo][Ss][Tt][:/].*’ (id: )

    Any ideas?

    Thanks, Matt

    • Matt Fette Reply

      Hi Timo:

      We are able to add the extension without issue when using localhost in the .trex file. However, if we try to use the actual server name: 1qvbidb01, it keeps returning the same parsing error, both local on the 1qvbidb01 DB server and remote from the actual Tableau server. Is localhost hard wired in whatever is processing the .trex file? We would really love to be able to run this from our Tableau server.

      Thanks, Matt

      • Timo Tautenhahn
        Timo Tautenhahn Reply

        Hi Matt,
        I‘ve overseen that you‘re using http. All extensions must use HTTPS. Localhost is the only exception as it allows you to quickly test extensions locally.

        Maybe that’s causing the error. So please get your server a certificate so that it’s HTTPS ready.

        Thanks,
        Timo

        • Matt Fette Reply

          Hey Timo:

          That did the trick. We applied a public wildcard SSL certificate to the domain and changed the URL in the .trex file to https. We were then able to get it to work, but we were having mixed content issues where it was only showing secured content. We also had to modify the URLs for the two CDN subdomain URL’s (datatables.css and datatables.js) to use https rather than http in the index.html file. Once we did that, everything worked.

          We really appreciate all your help. Now it’s time to try and convert to SQL Server from MySQL, and potentially IIS from Apache.

          Thanks, Matt

          • Timo Tautenhahn
            Timo Tautenhahn

            Awesome! Glad to read this!

            Please keep us updated. Maybe you want to feed your modifications back to the great Tableau community. I‘m happy to let you create a „guest post“ so that Tableau fans globally can leverage your great work around MSSQL and IIS!

            Thx,
            Timo

  8. Matt Fette Reply

    Will do.

  9. Pingback: tableaufans.com » Tableau Extension:  Writeback for SQL Server using Tableaufans.com’s MySQL Writeback as a Baseline

  10. Timo Tautenhahn
    Timo Tautenhahn Reply

    Hi Matt,
    Hi Tableau Fans,
    the one and only David Spezia just joined us on Tableaufans.com. In his first post he created a step-by-step guide on how to replace MySQL with Microsoft SQL Server for this Tableau Extension:

    https://tableaufans.com/extension-api/tableau-extension-writeback-for-sql-server-using-tableaufans-coms-mysql-writeback-as-a-baseline/

    Please let us know if this works fine for you.
    Thanks a lot,
    Timo

  11. Matt Reply

    Hi Timo:

    I’m glad I checked the blog before starting on this. Sorry for taking so long getting back to it. Thanks David! We did pretty much what David did, but replaced Apache with IIS and installed a security certificate so we could move beyond the developer’s localhost environment:
    * Tableau requires that you have a certificate/https if you are using anything other than localhost.
    * Install the certificate.
    * Update the manifest/trex file with the https URL.
    * You will need to install the latest SQL Server-PHP drivers. You can use the Web Platform Installer in IIS to search for and install the latest drivers.
    * On the Tableau Server, log on as an administrator. Click on the ‘Settings’ link, then on the Extensions link. You can now update Tableau Server with the https URL for the extension. Set the Full Data Access dropdown to Allow and the User Prompts dropdown to Hide.

    Matt

  12. Pingback: tableaufans.com » How to write back data to SAP HANA?

  13. Pingback: tableaufans.com » How to write back data to Microsoft SQL Server, MySQL or SAP HANA?

  14. santhosh Reply

    Hi Matt,
    Im facing the same issue here. I need to write back something into MYSQL DB which is in other machine and not in the Tableau server machine.
    What are the steps has to be done? Can you elaborate. It would be more helpful. Thanks in advance.

  15. santhosh Reply

    Hi Timo,
    Until step 5, I have done. Please help here to make sure how to start the services.

    Thanks

  16. Santhosh Reply

    Have received the below error,

    1:24:43 PM [main] XAMPP Version: 7.0.23
    1:24:43 PM [main] Control Panel Version: 3.2.2 [ Compiled: Nov 12th 2015 ]
    1:24:43 PM [main] You are not running with administrator rights! This will work for
    1:24:43 PM [main] most application stuff but whenever you do something with services
    1:24:43 PM [main] there will be a security dialogue or things will break! So think
    1:24:43 PM [main] about running this application with administrator rights!
    1:24:43 PM [main] XAMPP Installation Directory: “c:\xampp\”
    1:24:43 PM [main] Checking for prerequisites
    1:24:43 PM [main] All prerequisites found
    1:24:43 PM [main] Initializing Modules
    1:24:43 PM [Apache] Problem detected!
    1:24:43 PM [Apache] Port 80 in use by “Unable to open process” with PID 8640!
    1:24:43 PM [Apache] Apache WILL NOT start without the configured ports free!
    1:24:43 PM [Apache] You need to uninstall/disable/reconfigure the blocking application
    1:24:43 PM [Apache] or reconfigure Apache and the Control Panel to listen on a different port
    1:24:43 PM [Apache] Problem detected!
    1:24:43 PM [Apache] Port 443 in use by “Unable to open process” with PID 8640!
    1:24:43 PM [Apache] Apache WILL NOT start without the configured ports free!
    1:24:43 PM [Apache] You need to uninstall/disable/reconfigure the blocking application
    1:24:43 PM [Apache] or reconfigure Apache and the Control Panel to listen on a different port
    1:24:43 PM [mysql] Problem detected!
    1:24:43 PM [mysql] Port 3306 in use by “Unable to open process”!
    1:24:43 PM [mysql] MySQL WILL NOT start without the configured ports free!
    1:24:43 PM [mysql] You need to uninstall/disable/reconfigure the blocking application
    1:24:43 PM [mysql] or reconfigure MySQL and the Control Panel to listen on a different port
    1:24:43 PM [main] Starting Check-Timer
    1:24:43 PM [main] Control Panel Ready

    Hope due to port, the services are not getting started.

  17. Timo Tautenhahn
    Timo Tautenhahn Reply

    Hey Santosh,
    please to the following:

    1. Did you download the XAMPP I’ve been providing you with within my blogpost? There shouldn’t be any service running on 80. I’ve pre-configured my XAMPP to use port 8888.

    2. In order to run XAMPP you NEED to have ADMIN RIGHTS on your machine. Can you right click on the *.exe and say “Run as administrator”?

    3. Once you’ve made sure you’re running XAMPP as administrator you COULD manually change the ports, BUT changing the ports WILL REQUIRE CHANGES within the SOURCE CODE! Therefore this is not recommended unless you know where to adjust it within the code!

    –> If you still can’t run XAMPP because of the use of port 8888 and 3306 you might already have a web server and MySQL in place. In this case you could simply copy the content of “htdocs” into your existing web server as well as moving the table(s) from the MySQL database within my XAMPP into your existing MySQL database. My advice is to get this Extension up and running on a blank machine (Virtual Machine) first. Once this is working you can move piece by piece into your own environment which is way easier than modifying pieces from within the tutorial before it fully works.

  18. Caleb Thompson Reply

    Hi there,
    I followed all of the steps. However, when I place the extension into the dashboard, it looks like this: https://ibb.co/6WfcD5h

    Have you ran into this issue before?

    • Timo Tautenhahn
      Timo Tautenhahn Reply

      Hi Caleb,
      Yes, it happened to me when I was not having an internet connection. The Extension leverages libraries which are publicly available and therefore recquire having an internet connection.

      • Caleb Thompson Reply

        Thank you for replying. I looked into the Tableau log file and there is an error: “WebPage javaScriptConsoleMessage: message=Uncaught ReferenceError: $ is not defined sourceId=http://localhost:8888/extensions-api-master/myExtensions/Tableaufans-WriteBack-2018.2/MarksSelection.js lineNumber=6”

        Line 6 is: $(document).ready(function () {

        I can view the index file properly (formatted correctly) in Chrome, but within Tableau it looks like this https://ibb.co/6WfcD5h

        • Caleb Thompson Reply

          The way to solve this is to download all of the datatable libraries locally and reference the file path instead of the URL. This seemed to do the trick.

  19. Ryan Reply

    Timo – got everything working, but the workbook is not writing back on the download icon in your extension. Doubled checked the troubleshooting tips and all is good there.

    • Timo Tautenhahn
      Timo Tautenhahn Reply

      Hey Ryan,
      what do you see within Chromium once you’re pressing the “Write Back” button? (Once you opened Tableau in debug mode you should see something like this https://youtu.be/1qswvPhd8Yk?t=127)

  20. Jackie Reply

    Any chance this I could modify this to work with Postgres?

Leave a Reply to Francisco Cancel reply

*

captcha *