1 Reply Latest reply on Dec 13, 2017 3:53 PM by Patrick A Van Der Hyde

    Display message when Viz is not loaded

    Hugh Nguyen

      Below is a workaround to a common requirement.

       

      Requirement:

      I'm embedding a dashboard, how do I display a custom message when the viz isn't loaded? Or how do I display a custom message before the viz is loaded?

       

      Typically, the requirement is to display a message only when a view isn't loaded. At the moment, there isn't a javascript callback function that will return the status of the viz, server, request, or permission of the user.  For network status, I suggest voting up on this idea https://community.tableau.com/ideas/3862.  For requirements around permissions, it's better to check the user's permissions with the rest api before embedding the dashboard in the portal.

       

      Workaround:

      Until necessary callback functions or more involved implementations are available, here's a simple alternative to displaying custom messages. Rather than displaying a custom message when a view isn't loaded, let's reverse the logic and hide the message when a viz is loaded. This will mean that by default, the message is always displayed. Or in this example, the message is displayed after 1 second (this should be adjusted to better match your expected loaded time of the view) has passed and the viz still hasn't loaded, and when the viz is loaded (onFirstInteractive), the default message is cleared out. See attached example. I hope this is helpful.