Hi
I have a simple result from a SQL query in PAD stored as a Data Table in the variable QueryResult. This is what the data looks like.
I want to be able to format this into the body of an email (without the # row identifer) so just columns Pathway and Tot. What is the best way of formatting and manipulating this so I can insert into the body of an email?
Any advice would be welcome.
Thank you.
Jon
Hi @JonL_srft
You can loop through the datatable, pick only the values of Pathway and Tot columns and form the HTML table tags as per your requirement.
For example:
The below html..
<!DOCTYPE html>
<html>
<body>
<h2>Below are the required details</h2>
<table border=1>
<tr>
<th width="50%">Pathway</th>
<th width="30%">Tot</th>
</tr>
<tr>
<td></td>
<td>08</td>
</tr>
<tr>
<td>P0</td>
<td>27</td>
</tr>
<tr>
<td>P1</td>
<td>30</td>
</tr>
</table>
</body>
</html>
Will give you the output as below..
You can add centre alignment tags etc.
Taking the above syntax, during the loop you need to form the string as follows
<td>%CurrentLoopValueHere%</td>
Once you have the html string use it to send it in the body section while sending the email.
That's great thank you! I will give this a try.
Jon