Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
adbawany
Contributor
Contributor

Talend Newbie

Hello Everyone,

 

I have recently started using Talend. I am trying to create and schedule a job that extracts data from a MySQL database and email the results. 

 

This is what my Designer section looks like.

0683p000009M7tD.png

 

The data is being fetched BUT

Issue 1: instead of just one email, several emails are being generated with identical results.

 

I have used tJavaRow to incorporate some js into my job. To show the output in a table format, I have used html tags:

The email that is being received looks like this:

 

0683p000009M7tI.png

 

This is what my tJavaRow code looks like:

output_row.EngineID = input_row.EngineID;
output_row.Status = input_row.Status;



if (input_row.Status.equals("Server Was Rebooted!")){
	output_row.color = "Red";
}else 
	output_row.color = "Green";

	

String msg = ((String)globalMap.getOrDefault("mailMsg", "<table><tr><th>EngineID</th><th>Status</th><th>color</th></tr>"));
msg = msg +
 "<tr>" +
 "<td>" + output_row.EngineID + "</td>" +
 "<td>" + output_row.Status + "</td>" +
 "<td>" + output_row.color + "</td>" +
 "</tr>";

globalMap.put("mailMsg", msg);

Issue 2: why doesn't the email show the table borders? I have also tried inserting table border in my html tags? where can I put the css? it gives me errors when I place them in my tJavaRow component.

 

Any good practices that you would like to share with a newbie?

Labels (2)
1 Reply
Anonymous
Not applicable

Hi
In this case, you should use tJavaFlex instead of tJavaRow, you can learn the difference between these two components in this article
https://community.talend.com/t5/Design-and-Development/What-is-the-difference-between-tJava-tJavaRow...

And change your job to
tMysqlInput--main--tJavaFlex--main-tFileOutputDelimited
|onsubjobok
tSendMail

It will send only one email in the end of job.

Regards
Shong