Pentaho

 View Only

 Convert table input result to verbose output to use in mail body

  • Pentaho
  • Kettle
  • Pentaho
  • Pentaho Data Integration PDI
Max Bobzien's profile image
Max Bobzien posted 07-22-2019 15:56

Hi,

Is there an easy way to take the data from a Table Input step and convert it somehow to get the verbose output like when running SQLs in the console?

Order Ref    ASIN        Location    Case                Due Date    IDXXjxgkYRS    XXX1DQ48M5    0130403050    1234500000812889    2019-07-19    14XX2ThCPpC    XXXCU2Y2Y0    0133102050    1234500000810658    2019-07-19    14XXLQFqTNC    XXXCU2Y2Y0    0133403040    1234500000810659    2019-07-19    14XXY5kg0xC    XXX0AOJ9W6    0253606060    1234500000831639    2019-07-19    14XXSYGFdFC    XXXNQF5OWA    0282105050    1234500000839660    2019-07-19    14

I want to take that output and then put it directly into the e-mail body instead of attaching a text file.

I know that I can use JS to build it column by column but is there anything more flexible/simple?Max


#Pentaho
#PentahoDataIntegrationPDI
#Kettle
Dean Flinter's profile image
Dean Flinter

There are 2 ways of doing this that I am familiar with

The first is to export the result as an XML file and then use an XSL transformation to output it to a html file. You then need to process the HTML file by grouping it into a single line and setting the result to a variable. You can then reference the variable in your mail output

The second option is similar but might be a little easier. Use Pentaho Report Designer to create a report that uses your table input query. Design it how you want. Then in PDI choose a PRD Output step and output the report as a html file. You then process the html in the same way

Attached is an example job (and internal transformations) that does the 2nd option. Just save them all in the same directory and change the paths to the report PRPT file and where you want to store the html.

Data Conversion's profile image
Data Conversion
Attachment  View in library