I want to take the name of a pipeline coming from the input stream directly so I can use the values to generate an HTML table in the Email Sender snap and write a report without having to generate a file first, so it can be more convenient.
My code looks something like this:
"<p>Hello,</p>" +
"<p><strong>Message</strong></p>"
+
"<table class=\"table table-striped\">
<thead class=\"thead-dark\">
<tr>
<th>Pipelines</th>
</tr>
</thead>
<tbody>
<tr>
<td>" + $Pipeline + "</td>
</tr>
</tbody>
</table>"
However, my issue with this is while it does take the values from the input stream, it repeats the first row based on how many input documents there are. If I were to have 5 input documents, I would get for example Pipeline_1
repeated 5 times. The expression does not process the values after Pipeline_1
.
I have tried using the $("Pipeline:contains(Pipeline_1)");
method, however, this expression doesn't work and neither does the match
expression.
Any suggestions?
You can send incoming documents as an HTML table quite easily using the Email Sender snap.
From SnapLogic Docs
Pipeline:
Following is the test pipeline I made to demonstrate this.
Input:
Following is the Input JSON (created based on the description you provided) that I configured in the JSON Generator snap.
Configuration:
Following is an Email Template that I got from Snaplogic docs.
Configuration required other than setting the template -
$
which is the root elementFollowing is a screenshot of the settings I used in the Email Sender snap.
Note: The document structure needs to be flat.
As far as the batch size is concerned -
Result:
Following is the screenshot of the mail I received.
References: