tableau / VizAlerts

Data-driven alerting for Tableau Server
MIT License
212 stars 91 forks source link

The Advanced function data into VIZ_CSV() report #170

Closed TNS-reaj closed 4 years ago

TNS-reaj commented 4 years ago

Hi, When I set up the advanced email, the Email Action, Email Subject, Email body, and Email Attachment are in the details with the report data on the same page. (see screenshot #20). If these Advanced tabs do not in the details then the Advanced alerts don't work. In the tableau report, the data is fine. (see screenshot #21). When I received the vizalerts notification email with the attached CSV file, the CSV file report data include Email Action, Email Subject, Email body, and Email Attachment data. How did this happen?
Please advise.

20 21 22

Thanks

jdrummey commented 4 years ago

Hi,

This is expected behavior. The VIZ_CSV() content reference is pulling down all the fields used in the visualization (everything on Columns, Rows, Pages, and the Marks card) so that includes the Email fields.

What you need to do is build two views: one that has the email fields and is subscribed, and the second that has the content for the VIZ_CSV() content reference with just the fields you want included in the attachment. I'm sorry this wasn't clear in the documentation, if there's something that you can point at to help us clarify that distinction for Advanced Alerts we'd be glad to add it!

Jonathan

TNS-reaj commented 4 years ago

Hi Jonathan, Do you have an example of building two views that you mentioned here? Not sure how this exactly looks.

Thanks

jdrummey commented 4 years ago

Take a look at the VizAlertsDemo workbook test alerts https://github.com/tableau/VizAlerts/blob/master/docs/install_guide.md#put-vizalerts-through-its-paces-test... The VizAlertsDemo/AdvancedAlerts view shows a number of Advanced Alerts that have been configured. This view has the Email fields and then the content references are pointing at other views (which happen to be in this workbook, but could be entirely other workbooks).

Jonathan

TNS-reaj commented 4 years ago

Hi Jonathan, I have reviewed VizAlertsDemo and tried it again. When I copied AdancedAlerts view from Demo to my workbook then configured them with our info and added them to the Detail shelf (see screenshot #23). Then copied these AdvancedAlerts files to the workbook view which I need to send an email out(see screenshot #24). When I received an email, I only received a simple alert. The VizAlerts doesn't recognize AdvanceAlerts. Only when I add these AdvanceAlerts to the detail shelf in my workbook then the VizAlerts will send advanced alerts to my email but the CSV file report data will include Email Action, Email Subject, Email body, and Email Attachment... data. Do I miss anything in the step?

Thanks

23 24

TNS-reaj commented 4 years ago

Hi Jonathan, I tried to republish the vizalerts\demo Advanced Alerts (tests) again and found the errors. See below. The server doesn't have any block. Why the 404 error in here? Please advise.

2020-10-19 10:32:14 - [ERROR] - HTTP error getting vizdata from url https://xxxxxxxxxx.edu/views/VizAlertsDemo/Product?Region=West&:format=pdf&amp ;:refresh=y. Code: 404 Reason: Not Found 2020-10-19 10:32:14 - [ERROR] - Unable to render content reference VIZ_PDF(VizAl ertsDemo/Product?Region=West|filename=WestSales|mergepdf) with error:
HTTP e rror getting vizdata from url https://xxxxxxxxxx.edu/views/VizAlertsDe mo/Product?Region=West&:format=pdf&:refresh=y. Code: 404 Reason: Not Fou nd 2020-10-19 10:32:14 - [ERROR] - Alert was triggered, but encountered a failure g etting data/image references:
Unable to render content reference VIZ_PDF(V izAlertsDemo/Product?Region=West|filename=WestSales|mergepdf) with error:
HT TP error getting vizdata from url https://xxxxxxxxxx.edu/views/VizAler tsDemo/Product?Region=West&:format=pdf&:refresh=y. Code: 404 Reason: Not Found 2020-10-19 10:32:14 - [ERROR] - Unable to process alert Advanced Alerts Demo as csv, error: Alert was triggered, but encountered a failure getting data/image re ferences:
Unable to render content reference VIZ_PDF(VizAlertsDemo/Product ?Region=West|filename=WestSales|mergepdf) with error:
HTTP error getting viz data from url https://xxxxxxxxxx.edu/views/VizAlertsDemo/Product?Regio n=West&:format=pdf&:refresh=y. Code: 404 Reason: Not Found 2020-10-19 10:32:14 - [DEBUG] - All errors found: 2020-10-19 10:32:14 - [DEBUG] - Unable to render content reference VIZ_PDF(VizAl ertsDemo/Product?Region=West|filename=WestSales|mergepdf) with error:
HTTP e rror getting vizdata from url https://xxxxxxxxxx.edu/views/VizAlertsDe mo/Product?Region=West&:format=pdf&:refresh=y. Code: 404 Reason: Not Fou nd

Thanks

jdrummey commented 4 years ago

Hi, a 404 error in this case means that the VizalertsDemo workbook either hasn't been published, or was published under a different name, or there aren't sufficient permissions to access the workbook.

A good test is to a) copy the URL from the log, b) in your web browser log into Tableau Server using the VizAlerts run-as user, and c) then paste the URL in to go to that. If you can't log in or see the URL from your web browser using the Vizalerts run-as user then VizAlerts won't be able to either, and you'll need to diagnose what's going on.

Jonathan

jdrummey commented 4 years ago

re: your earlier post with the screenshots there's too little information for me to see what's going on and help you. For example I can't see the values of the Email Action, Email Subject, Email Attachment, etc. fields. So let me try to give you an example from our production configuration of VizAlerts:

For one of our projects the use case is to email out a set of dashboards as PDFs on a monthly basis to some users. The configuration is as follows:

  1. The Advanced Alerts trigger view is located in the view VizAlerts1/EmailDistrict1 (i.e. VizAlerts 1 workbook, Email District 1 worksheet). It's built as a simple text table so we can easily review all the values and is configured to have one row per alert. Note that it has the Email Action field that tells VizAlerts to treat this as an Advanced Alert and not a Simple Alert:

2020-10-19_11-59-07

The VIZ_PDF() content reference that is in the Email Attachment District 2 field is pointing to views in another workbook in the site, in this case the full content reference is something like VIZ_PDF(ZambiaMalariaReportingDashbords/Risk-Overview-District?District=ce%20%Chibombo%District).

  1. The trigger view from #1 is published to Tableau Server and subscribed to one of the VizAlerts subscriptions that have been configured as a disabled subscription per the VizAlerts install guide.

  2. When VizAlerts runs on the monthly schedule it downloads the trigger view from VizAlerts1/EmailDistrict1, then per the configuration of the each row of the trigger view downloads the content references from other views, assembles each email, and delivers the emails.

I hope this helps! My suggestion for you from here would be to:

  1. Set up an Advanced Alert trigger view as a separate worksheet and built it in text table form like the one above with all Email fields as discrete (blue) fields on Rows.

  2. Validate that the VIZ_CSV() content reference is accurate per the instructions at https://github.com/tableau/VizAlerts/blob/master/docs/user_guide.md#custom-view-references-getting-almost-any-view-from-tableau-server

  3. Try to run the advanced alert by going to the trigger view from step 1 and using test_alert.

  4. If that doesn't work and you're not able to debug what's going on, then post again here with a screenshot of the entire trigger view window including the Rows, Columns, and Marks Card displayed (like the screenshot I'd posted above).

Regards,

Jonathan

TNS-reaj commented 4 years ago

The 404 link is

https://xxxxxx.edu/views/VizAlertsDemo/Product?Region=West&:format=pdf&:refresh=y.

But I can open the demo file in tableau with the below link:

https://xxxxxx.edu/#/views/VizAlertsDemo_15955180561540/DataForDownload?:iid=3

I see the difference between these two links is the #/ before the views missing in the error link https://xxxxxx.edu/#/views/

Any thoughts?

Thanks

TNS-reaj commented 4 years ago

The VisAlertsDemo is under the Explore / Default

jdrummey commented 4 years ago

Hi,

The two URLs you gave are actually different views (first is Product, second is DataForDownload) from different workbooks (first is VizAlertsDemo, second is VizAlertsDemo_15955...).

For VizAlerts to run and pull content references the referenced workbook/viewname has to match exactly. My guess is that the Viz Alerts Demo workbook was already published (and perhaps removed?) from Tableau Server, and then the one that you are accessing now was published at a later time because the added _########### to the end is standard behavior for Tableau when two workbooks are published with the same name. (The first workbook with that name uses the workbook name, the second workbook gets a unique # appended to the name).

There are a couple of options here to use the VizAlertsDemo workbook: One is to make sure that you have access to the original VizAlertsDemo workbook, the other would be to update the content references in the trigger view of the VizAlertsDemo workbook to point to it's new workbook name of VizAlertsDemo_15955...

Jonathan

TNS-reaj commented 4 years ago

Hi Jonathan, The VizAlertsDemo issue fixed. I have create another view called Advanced Alerts with all the Email Action*,Email Attachment.. etc. (See screenshots #27-#31). Email Attachment point to the view which I want to attached csv file in the email. (see screenshot #33 and #31). After run the test, I have received email with all correct subject, email body..., and attachment csv file. (See screenshot #34). But the csv file data is incorrect. (see screenshot #35). The correct data shows in screenshot #33. Not sure how this happened. Please advise. Thank you! 27 28 29 30 31 33 34 35

TNS-reaj commented 4 years ago

It seems the VIZ_CSV() didn't point the correct view.

jdrummey commented 4 years ago

Hi, the VIZ_CSV() reference is just the workbook/viewname, so VIZ_CSV(PreBillingDEV102120/Pre-billEstimatedBill) or something like that (I'm not sure if the =Pre-billEstimatedbill is actually part of the view name or an attempt at adding a URL parameter as a filter).

TNS-reaj commented 4 years ago

I tried the reference name get from the tableau view link which is PreBillingDEV102120/Pre-billed_Estimated_Bill?:iid=2 that worked.

Thank you so much for your help.

TNS-reaj commented 4 years ago

The additional question: The CSV output file columns are ordered by alphabet letters. Is there any way can set the CSV output file order like the Tableau report?