Toad World® Forums

Toad Data Point Email Array

Does TDP support an array of values to output stored lists to email? The process of having to create separate files and then concatenate them again is a bit tedious and it seems like an array would make that much easier. If that exists already then I'd like to confirm how that is accomplished.

Might need more details on what you want the "stored list output" to look like, and if you're attempting to accomplish this within TDP's automation engine, etc. Such output could take the form of an Excel spreadsheet, or even a table (e.g. an "array" of records) saved in your Local Storage.

In the past we've output to html and then used something like powershell to concatenate all the pieces, but that makes the construction of a basic email from a template a more involved process with an email design template.

In the current scenario we have a header and footer, a sql generated summary of data points, and then a sql generated detail list that requires multiple iterations. To make all this work the header and footer are separate html files and then the contents have to be written to file and then everything concatenated. The summary doesn't require multiple iterations per email, but the detail does so there's a M:1 relationship between the detail and the summary.

It's a time consuming process so if the contents could be captured to a variable they could be written to each email in one shot and if TDP supported email design templates the output could be written to the file and sent without the need for powershell scripts.

A column format works if you're outputting variables directly to email, but there's no option to write to a text file in a name:value format. All formats TDP supports uses a header and rows and there is only an option to include HTML as the body which effectively overrides anything that is in the body of the email. There's no option to include HTML with the body only AS the body.

Also it seems to be having problems writing HTML today.

PKýrÎR]Ù”ö£xl/theme/theme1.xmlíY[oÛ6þ+„ÞWÉÙq§H|i¶$mgúHK´Äš’Jê·!}0X7ìeÀÞö0lÐ{X†ý˜l¶È_%ßH›JÚÕ: ˆäwÎùx®²sõó¯ewGœ Æ1›VéŽc{ÔÇqдR1xoͺ»¹×Eˆ"$8æë°i…B$ë¶Í=¹ ùš Xž (‹ KØ>ƒ§RIDì²ãÔìâØ1ŒPÓz0£L¥5SÞ!òW,x¶áÖór‹ªDŽõ‡¥ìñaà’¦%íøôô=°77숈ì7øÃrŽcA¬VÝjmk®°l$¡|œÚÓ€ƒù3`T|„EØa"í”rŸè8H(—cÄ*Tž¡4Ú§þx·Tr¦Ð¤ó9‡farl‰ñv­®

I'm pretty sure you have a bug because I had to output to csv, which I confirmed was writing to file correctly, and then I had to switch to HTML a second time at which point the Export options button dimmed. So there is a bug with how to activate and deactivate that option correctly. Choosing HTML as an option has conditions where the Export option button does not dim and continues to write as Excel.

Long story short, I don't think there's a "packaged" way to do this in TDP. There is a "Loop Dataset" task in the Automation Engine that you might consider to get close, if you haven't used this already. Idea is that if you have a dataset that contains on each row, info about the summary, and account details, then it's possible to loop through that "driver file" to

  • Have TDP assign variables to the Summary and Detail data items in the current driver record
  • Execute a query to create the one-time Summary output (as a file or table)
  • Execute the individual queries for each account (as files or tables)
  • Snap the outputs together (maybe shell out to call the utility that does this?)
  • Create the e-mail and attach the finished output

Certainly appears to be a bug... I'll suggest (please) that you open a Support ticket with Quest so that our engineers can document and prioritize the fix.

Appreciate the feedback Gary. What you're describing is precisely what we've been doing. The data loop does come in handy. This time around I had to concatenate label placeholders to my sql output and then do some find and replace on HTML elements in powershell to restructure the output from rows to columns and insert the column headings. It was easier than expected, but took time to work out.

I'll see if I can capture what is happening with the HTML format options and submit it. In the simplest of terms it looks like that option button status doesn't persist and requires a little more encouragement to know when to turn off and switch to HTML.

1 Like

Ah, yes, wish all software could have an "Encouragement" button, so to speak. :upside_down_face:

R&D would certainly appreciate if you could capture the steps to the HTML weirdness and submit to Support.

2 Likes