8 Replies Latest reply on Aug 7, 2018 12:50 AM by Dilyana Suleymanova

    Send PDF after the subscription

    Dilyana Suleymanova

      Hello there,

      I have a problem by sending a pdf file using VizAlert.


      I worked through the VizAlertDemo file and tried everything out. For example this sheet with sending PDF as an example.


      It works very well so far.


      Now I want to test the option: Subscription directly from a workbook.

      So I've chosen one sample workbook and subscribed to this one:



      I also see my subscription here:

      Then I run a test with the command: test_alert


      However, instead of pdf file I get csv




      How can I get a pdf file after the subscription?


      Thank you!


        • 1. Re: Send PDF after the subscription
          Matt Coles

          Hey DS. Have you already added the Email Action and other necessary fields to your viz? These are how you tell VizAlerts what to put in the email. Without them, it will fall back to some basic defaults, which is what you are seeing right now. You see the Email Action field in the sample viz, along with all the other "Email..." fields? You must create at least Email Action and add it to the level of detail in your actual viz. For more on this see: VizAlerts/user_guide.md at master · tableau/VizAlerts · GitHub


          Furthermore, you should be aware that when you subscribe to a dashboard with multiple vizzes in it, only the one that comes first alphabetically is recognized by VizAlerts. An easy way to pick the one you want is to prepend "-" or some other character to it so that it comes first alphabetically.

          • 2. Re: Send PDF after the subscription
            Dilyana Suleymanova

            Hey Matt, thank you for your reply.

            Actually, I want to get the whole dashboard as a pdf file. Do I need to put all needed fields (Email To, Email Attachment etc.) to every sheet? Is it possible to subscribe to the dashboard (with more then 1 sheet in it) and get a PDF File?


            Also I don't understand why you write "be aware that when you subscribe to a dashboard with multiple vizzes in it, only the one that comes first alphabetically is recognized by VizAlerts"


            When I run this test from the workbook VizAlertDemo, I get the pdf file for the whole dashboard.

            • 3. Re: Send PDF after the subscription
              Jonathan Drummey

              Hi Dilyana,


              The most common reason for getting an attached CSV and embedded PNG instead of the desired PDF is that the Schedule for the alert hasn't been marked as Disabled so when VizAlerts runs it picks up the alert as a Simple Alert (and sends the CSV+PNG) instead of a PDF.


              If the Schedule is still active (you can tell if the schedule has a date for the Next Run At instead of showing Disabled) then disable it and try again.


              If the Schedule has been marked as disabled and you're still getting the results then let us know and we'll do a deeper dive.



              • 4. Re: Send PDF after the subscription
                Dilyana Suleymanova

                Hi Jonathan,

                thank you for the explanation!

                However, I still have the problem.


                The Schedule is disabled:

                I also checked up the URL and the name of the sheet. It is ok.




                In every sheet on this dashboard, I created the calculation field: 'Email attachment' and put it into the details shelf:





                I also adjusted the calculation field 'Email Attachment' in the VizAlertDemo Book


                After that I run the test from the dashboard Global Temperature


                and get the email with csv and png :/  (not pdf file)


                What is my mistake?

                • 5. Re: Send PDF after the subscription
                  Matt Coles

                  Okay, I see the problem.


                  The way VizAlerts works is that you have one viz that functions as the "trigger viz" for it. This is the viz that all your Email ___ fields are added to. In this way, it serves as an instruction set for what VizAlerts should do. So on the trigger viz, you would add your Email Attachment field and reference whatever other viz you want attached to your email.


                  So in your case, it's not clear which viz you are using to trigger the emails. It looks like the VizAlertsDemo sheet would be the best candidate. The calc you show in that screenshot for Email Attachment is correct. You do not need to add any other calculations to any other vizzes, besides that one. Now, to run the VizAlert, add your test_alert comment to the trigger viz--which is the same sheet in VizAlertsDemo. VizAlerts will then read the data from that viz, interpret each mark as an instruction to send an email, and reach out separately to grab Regional/GlobalTemperatures as a PDF and attach it to the one it sends. The Regiona/GlobalTemperatures sheet does not need to "know" that any of this is happening--it is just a normal viz on Tableau Server like everything else.


                  Try that and let me know if it works for you.

                  • 6. Re: Send PDF after the subscription
                    Dilyana Suleymanova

                    HI Matt,

                    sorry for such delay answer! I was on vacation :-)


                    I tried out the adding the test_alert comment to the trigger viz. It works. I got an email with PDF file.


                    However, our customers want to subscribe the vizes from the dashboard. When I subscribe for the viz from the dashboard (see my approach above) I'll get a csv file.

                    Could you please confirm, that I have to run a process manually from the VizAlertDemo Book in order to get a PDF file (There is no possibility to get a pdf file by subscribing with the button: Subscribe on the dashboards).


                    Thank you in advance!

                    • 7. Re: Send PDF after the subscription
                      Matt Coles

                      So, the answer is yes, it is possible--but it is complicated at the moment.


                      First: You do not need to subscribe to the VizAlertDemo workbook to obtain PDFs of the dashboard you actually want attached to your email. You can embed the necessary "trigger" information into your "pretty" viz that your customers will subscribe to. The key is this: The name of the sheet you use to trigger the VizAlert must come first alphabetically before the other sheets in the dashboard. Typically, I use a hyphen ("-") in front of the sheet name to force it to come first. You can then embed the sheet directly as you have it in the screenshot above, and minimize it so that it is basically invisible in the dashboard, as shown here in the User Guide.


                      But that process only works for the owner of the viz. Others subscribing to the viz on a VizAlerts schedule will result in VizAlerts complaining that they aren't the owner, so the alert won't be processed. This is something I plan on changing in the next version--so it will work in the future, but it doesn't right now. However,  If you need a way to work around it in the meantime, you could connect to the Tableau Server Repository database, query it to see who subscribed to your viz, and trigger the alerts based on that. It would introduce some complexity to the viz, and take a few hours to configure, but it would work. Honestly, I'd probably just wait for v2.2.0 or whatever I come out with next.

                      • 8. Re: Send PDF after the subscription
                        Dilyana Suleymanova

                        Thank you for the explanation!