2 Replies Latest reply on May 3, 2017 9:21 AM by Matt Coles

    Tip: Make notifications more fun with randomization

    Matt Coles

      I like to keep people's lives interesting. In a good way. Especially if the email I built has to inform them of something negative, like nagging them about something they shouldn't be doing.


      One way I've had fun doing this is by building some randomization into my email alerts. Not only is it fun for people to see different information in the emails they get, but it helps them pay a bit more attention to them.


      As an example, we've got a strict policy on what queries are allowed to run on our SQL Server instance here at Tableau. Any queries that are blocking our ETL processes, or take up too much of our precious server resources are killed by a script that runs against the server every minute. When that happens, the script dumps information about the query that was killed into into a table. I've built a VizAlert off that table that notifies the user of the fact that their query was killed, why it was killed, and I try to offer some help around what they can do to prevent it in the future.


      But the fun part (well, fun for me anyway) is that I built a silly exclamation into the subject that is pseudo-random, based simply on the ID value of the table record for their killed query. This is done with a simple modulo operator on the ID value:




      I then embed that field into the Email Subject * field in my VizAlert:



      ...to the following, hopefully humorous, effect:








      Moral of the story: If you have to bug someone, might as well make them happy about it.