Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
With the output from a straight table, you can see in the pic1 below how I set up the sent email. However, Qlik will not give an output, see pic2. Then I put ion this HTML script, it's below the pics, and it will only return the 1st row from the Get Straight table output array. If I change the index from [0] to [*] it fails as well. I am not an html master by any stretch and even utilized Chat GPT which recognized an issue with the loop, but it failed multiple times (it's pasted below the 1st HTML section) in producing script that would work. Also there was mention of a template engine that Qlik uses, anyone know which one it is? Anyone have any thoughts on how to fix this?
pic1
pic2
HTML produces 1 row only, changing index to [*] fails:
<!DOCTYPE html>
<html>
<body style="font-family: Arial, sans-serif; font-size: 14px; color: #333;">
<p>Dear Team,</p>
<p>Please find below the latest Purchase Order receipt details:</p>
<table cellpadding="8" cellspacing="0" border="1" style="border-collapse: collapse; width: 100%; text-align: left;">
<thead style="background-color: #f2f2f2;">
<tr>
<th>PO Received At</th>
<th>PO Key</th>
<th>Product Number</th>
<th>Product</th>
<th>Quantity Received</th>
<th>CSR Representative</th>
<th>CSR Email</th>
</tr>
</thead>
<tbody>
{% for record in GetStraightTableData4 %}
<tr>
<td>{{ record.POReceivedAt }}</td>
<td>{{ record['%POKey'] }}</td>
<td>{{ record.ProductNum }}</td>
<td>{{ record.Product }}</td>
<td>{{ record['Sum(QtyReceived)'] }}</td>
<td>{{ record.CSR_Rep }}</td>
<td><a href="mailto:{{ record.CSR_Email }}">{{ record.CSR_Email }}</a></td>
</tr>
{% endfor %}
</tbody>
</table>
Hi @Seancy
Let me see if i can do a small example.
Hi @Seancy
You can try the following example and work on it change it to the way you like.
I assume there is an even better way to do this, but i did it on the fly.
It makes use of the custom code block, it uses a little javascript to create a string html representation of the table rows and their values.
Not super scalable depending on the number of columns you have.
Best Regards