1 2 Previous Next 18 Replies Latest reply on Jan 23, 2020 1:35 AM by Matiss Seglins

    Extension doesn't work once published on Tableau Server

    Matiss Seglins

      Extension works perfectly on Tableau Desktop, but once published on Tableau Server after the initial load the extension doesn't respond to any event listeners and seems to "hung up".

       

      The only thing I can see in console is the "Provisional headers are shown" warning.

       

      Has anyone had the experience of the Extension not responding/behaving differently once published on Server vs. Desktop?

        • 1. Re: Extension doesn't work once published on Tableau Server
          James Kording

          Hi Matiss Seglins,

           

          Did you enable the extension on the server and add the specific one you are using to the server?  Please see the steps below if you have not.

           

          Publishing on Tableau server:

           

           

          1. Make sure you have the "Enable users to run extensions on this server" checked in your site settings (On the server webpage)
          2. Add the extension URL to the site in settings (On the server webpage)
          3. Choose to Allow/Deny Full data access and Show/Hide prompts for the chosen extension. (On the server webpage)
          4. Publish workbook

           

           

           

          I hope this helps!

           

          Jim

          • 2. Re: Extension doesn't work once published on Tableau Server
            Matiss Seglins

            I believe the server is configured correctly as It works with some dummy workbooks (based on Excel) but not larger production ones based on SQL Server extraction. How could this be? After the initial load of the workbook the extension works well and I can see under Network in Developer tools the following calls being made:

             

            1. extension1.html
            2. jquery-3.2.1.min.js
            3. bootstrap.min.css
            4. bootstrap.min.js
            5. tableau.extensions.1.latest.js
            6. extension1.js
            7. initialize-add-in-instance
            8. get-summary-data

             

            However, after an event takes place on a Dashboard only the following calls are being made under Network:

             

            1. extension1.html
            2. jquery-3.2.1.min.js
            3. bootstrap.min.css
            4. bootstrap.min.js
            5. tableau.extensions.1.latest.js
            6. extension1.js

             

            As you see it skips the last two steps and the extension functions as if no event took place.

            • 3. Re: Extension doesn't work once published on Tableau Server
              Keshia Rose

              Hi Matiss,

               

              Are you still having this issue? Since the extension is not initializing it makes me think it is a settings or permissions issue. You mentioned it worked in tests but not in production, are those two different sites? If so they will need the extension added to both safe-lists.

               

              Take care,

              Keshia

              • 4. Re: Extension doesn't work once published on Tableau Server
                Matiss Seglins

                Yes, still having the issue, but now I've done more testing. It's the same production site, not two different sites. What I'm seeing is that the extension works perfectly on Tableau Desktop with all workbooks based on all data sources. However some workbooks work perfectly on Tableau Desktop, but once published on Tableau Server the extension only initializes once and after the extension becomes unresponsive to any changes in the workbook. Every time I want a change to be reflected in the Extension, I have to make a selection in a Dashboard, press F5 to reload page and then on and only on the initial load it will update the extension.

                 

                I've attache image to show in the green square the initial network load, and then with the red arrows pointing out subsequent clicks on the dashboard that for some reason do not initialize-add-in-instance and doesn't get-summary-data.

                 

                I really cannot understand why it's causing issues with some workbooks (maybe related to size) and not others?

                 

                Also below is a link to my project GitHub. The .js file has hard coded sheet and field name for now. You can download sample workbook (a working example) from there as well.

                2019-11-19_10-50-18.png

                https://github.com/StatsAnalysis/StatsAnalysis.github.io

                • 5. Re: Extension doesn't work once published on Tableau Server
                  Keshia Rose

                  Hi Matiss,

                   

                  Thank you for sending your workbook and extension!!! That makes troubleshooting soooooo much easier and I wish more people would do it!

                   

                  The first thing I'm noticing is that you are loading the data on load and every single time you select a mark or change a filter. I'm wondering if there is a problem based on when things are getting loaded, especially with larger workbooks. At first, I was going to send you an example with it loading on click but then I realized you did it this way since the copy command doesn't work in async functions. Then I thought maybe you can just shuffle around when the event listeners are being defined. So that's what I did, can you give the following extension a try in your bigger workbooks where it is not working? https://shadow-scene.glitch.me/SheetDropdown_Test.trex Here is the code if you just want to copy it instead: https://glitch.com/edit/#!/shadow-scene

                   

                  Take care,

                  Keshia

                  • 6. Re: Extension doesn't work once published on Tableau Server
                    Matiss Seglins

                    Hi,

                     

                    Thanks a lot for your help and cleaning up the code as well! Your version of the extension also works perfectly on Tableau Desktop but unfortunately has the same issue on Tableau Server as before - it runs the extension on initial load and then stops loading it when you do selections and filter changes.

                     

                    I'm not 100% sure why this is happening, but from the testing I've done so far the only thing I can point to is possible workbook size. The workbook is quite large and has around 100k rows which is why I put in the 500 limit for disabling the Copy button but you're right it doesn't prevent the entire block of code from running which is where the inefficiency is coming form.

                     

                    I will keep testing this more and will get back to you if I discover anything, let me know if you have another idea for how to better implement this. I'm very happy to get any help I can.

                     

                    Thanks!

                    • 7. Re: Extension doesn't work once published on Tableau Server
                      Keshia Rose

                      Darn! By the way what version of Desktop and Server do you have (all three numbers) and what browser are you using when you test?

                      • 8. Re: Extension doesn't work once published on Tableau Server
                        Matiss Seglins

                        Tableau Desktop 2018.3.7

                        Tableau Server 2018.3.0

                        Google Chrome 64 bit latest version

                        • 9. Re: Extension doesn't work once published on Tableau Server
                          Keshia Rose

                          Any progress Matiss? I was wondering if you could do a test where you only collect the data when the button is pressed. I know this won't work with the copy command so just log to the console. If that worked then you could at least determine if it's a timing issue.

                           

                          Take care,

                          Keshia

                          • 10. Re: Extension doesn't work once published on Tableau Server
                            Matiss Seglins

                            Hey, sorry I got overwhelmed as it's the end of the year, but I finally managed to do some more testing like you suggested. I used your version of the extension as the base.

                             

                            I removed the two event listeners in the .js file and added an extra button in the .html file to manually ran the code in addition to the copy button:

                             

                            <button id="RunBtn" onclick="getData()">Run</button>

                             

                            and indeed clicking on "Run" and then on "Copy" worked 100% of time on all workbooks. What do you think is the issue here then? Is it something related to Event Listeners?

                            • 11. Re: Extension doesn't work once published on Tableau Server
                              Keshia Rose

                              Hi Matiss,

                               

                              Hmmm, interesting, looks like it was a timing issue, perhaps the getData() function was being called before the data fully loaded, or perhaps the event listeners aren't getting added. We'd have to dig into it a bit more with a failing sample workbook to really figure it out. However, I'm glad you figured out a way to get it to work! Would this two-button solution work for you?

                               

                              Take care,

                              Keshia

                              • 12. Re: Extension doesn't work once published on Tableau Server
                                Matiss Seglins

                                Okay I did further testing this morning by duplicating the same workbook.

                                 

                                Version 1 has a dashboard with some 15 sheets, a lot of objects, pictures, filters, parameters etc. making it quite heavy. The extension doesn't function on it after the initial load and I have to do a full page refresh for it to register a change every time.

                                 

                                Version 2 I remove on the dashboard everything except for 2 sheets and the extension itself, republished and it worked like charm.

                                 

                                To me this sounds something like you mentioned where the getData() function was being called before the data fully loaded on this heavier dashboard (even though both versions work perfectly on Tableau Desktop).

                                 

                                I find it hard having to ask the end user to click on 2 separate buttons instead of 1 to perform a copy function. There has to be a way around this where it only calls for the function after the dahsboard/data has finished loading? I might be able to get you a sanitized version of a failing workbook if that would help?

                                • 13. Re: Extension doesn't work once published on Tableau Server
                                  Keshia Rose

                                  Hi Matiss,

                                   

                                  I really don't know if it's possible, you've reached the limits of my JavaScript knowledge. The problem is with the copy command needing to be triggered by the end-user and not a function. I know there is the newer Clipboard API but I haven't tried it out and it doesn't look like it is widely supported yet. I'll ask around for ideas but I'm really not sure if it's possible.  

                                   

                                  Take care,
                                  Keshia

                                  1 2 Previous Next