Tip: Generate XML with Velocity template with array/list data
Spent some time with null checks in the velocity template and would like to share the findings: If you have data in an array such as this example: [ { "Lines": [ { "TEST1": null, "TEST2": "Text" } ] } ] If you try to do a null and empty value check using standard velocity methods (such as this) you will run in to problems when the input data is from an array. Normally when doing null and empty checks you can simply use #if($TEST1 && $TEST1 != "") dosomething #end But when processing data in the array this will not work (the evaluation will be true even if the JSON input value is null: #if($Lines[0].TEST1 && $TEST1 != "") dosomething #end This will work (null value, empty value or if the variable does not exist in the array): #if($Lines[0].TEST1 != "***NO DATA***" && $Lines[0].TEST1 != "") dosomething #end Same think if you are in a #foreach loop #foreach($Line in $Lines) #if($Line.TEST1 != "***NO DATA***" && $Line.TEST1 != "") dosomething #end #end The thing where the value is set to ***NO DATA*** seem to be a SnapLogic behaviour, maybe someone can confirm this? I hope this will save someone a few hours.4.3KViews3likes1CommentHow to Configure an Email Sender Snap to Avoid Individual Emails per Record
If you configure an Email Sender Snap with an input view and connect it to receive data from upstream Snaps, one email will be sent for each document processed through the pipeline unless you are using HTML table as the Email type. The HTML table format will embed the data in the email body up to the Batch size limit, sending as many emails as necessary to batch through the documents. Alternatively, if you want to just send the details as an attachment to an email, do not add an input view. Instead, just place the Snap unconnected on the workspace, write the data to a file, and have the Email Sender Snap attach that file to the email.4.1KViews1like0Comments