Forum Discussion
Instead of using mapper, I suggest you to use the XML Generator snap together with Apache Velocity. From this dataset we can easily create desired table in mail.
Firstly, change Target field in GroupByN snap to "values".
After this, use an XML Generator Snap. Make sure your setting are same as below:
The following code goes into the XML generator snap.
<html>
<head>
<style>
table {
width: 100%;
}
thead th {
background: black;
color: white;
}
tbody tr:nth-child(even) {
background: #D9D9D9;
}
td {
padding: 5px;
}
</style>
</head>
<body>
<p>Hi Team,
</br>
TEST
</br>
</br>
<b>
<table>
<table border=1>
<thead>
<tr>
<th>DEMO_KEY</th>
<th>DEMO_CODE</th>
<th>DEMO_DESCRIPTION</th>
<th>DEMO_GROUP</th>
<th>DEMO_GROUP_2</th>
<th>DEMO_COUNTRY</th>
</tr>
</thead>
<tbody>
#foreach ( $values in $values )
<tr>
<td>$values.DEMO_KEY</td>
<td>$values.DEMO_CODE</td>
<td>$values.DEMO_DESCRIPTION</td>
<td>$values.DEMO_GROUP</td>
<td>$values.DEMO_GROUP_2</td>
<td>$values.DEMO_COUNTRY</td>
</tr>
#end
</tbody>
</table></body></html>Next, just place an Email Sender snap, add your account settings and in the property “Email type” select “HTML text”. Once you set this, just enable the expression for the “Template body” property and use the following expression to remove the “\n” characters.
$xml.replaceAll("\n", "")And this is the preview of email that this will generate:
Unfortunately, no. When you preview the parent, you can only see the preview output of the snaps in the parent. There’s no way to see the preview output of the snaps that executed in the child during the preview of the parent. The preview output that you’re seeing in the child pipeline is left from when you last previewed just the child pipeline by itself.
- ADORAISWAMY5 years agoNew Contributor II
Taylor,
Thank you. I am bit more clearer and closer to the fix now. I enabled all the snaps and all but validated one. Please see attached. I tried with and without toggling the “=” button but neither works.