<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Send query result by mail in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Send-query-result-by-mail/m-p/2320759#M90868</link>
    <description>&lt;P&gt;Using what is described in following link:&lt;/P&gt; 
&lt;P&gt;&lt;A href="https://community.qlik.com/s/feed/0D53p00007vCpHvCAK#M59354" target="_blank" rel="noopener"&gt;https://community.talend.com/t5/Design-and-Development/resolved-Sending-query-result-by-mail/m-p/100984#M59354&lt;/A&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I am able to send the query results by email but the email is print results column after column and not in row.&lt;/P&gt; 
&lt;P&gt;By that I mean if my table looks like this:&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Name&amp;nbsp; &amp;nbsp;Date&lt;/P&gt; 
&lt;P&gt;John&amp;nbsp; &amp;nbsp; &amp;nbsp;05-08-2019&lt;/P&gt; 
&lt;P&gt;Nas&amp;nbsp; &amp;nbsp; &amp;nbsp; 05-07-2019&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;The email that I get is this:&lt;/P&gt; 
&lt;P&gt;Name:&lt;/P&gt; 
&lt;P&gt;John&lt;/P&gt; 
&lt;P&gt;Nas&lt;/P&gt; 
&lt;P&gt;Date:&lt;/P&gt; 
&lt;P&gt;05-08-2019&lt;/P&gt; 
&lt;P&gt;05-07-2019&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;This is what I have in tjavarow:&lt;/P&gt; 
&lt;P&gt;context.StepName = context.Name+"\n"+input_row.Name;&lt;BR /&gt;context.Timestamp = context.Timestamp+"\n"+input_row.Timestamp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;And this is how the email message in tsendMail is composed:&lt;/P&gt; 
&lt;P&gt;"Name: "+context.StepName+ " Date:" + context.Timestamp+"."&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;What I would like to see in the result is each row with column header:&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Name&amp;nbsp; &amp;nbsp;Date&lt;/P&gt; 
&lt;P&gt;John&amp;nbsp; &amp;nbsp; &amp;nbsp;05-08-2019&lt;/P&gt; 
&lt;P&gt;Nas&amp;nbsp; &amp;nbsp; &amp;nbsp; 05-07-2019&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;How can I accomplish this?&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="talend_mail.PNG" style="width: 800px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M4QS.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/150063i2782A7FF5AF6C083/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M4QS.png" alt="0683p000009M4QS.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Wed, 08 May 2019 17:04:19 GMT</pubDate>
    <dc:creator>talendstar</dc:creator>
    <dc:date>2019-05-08T17:04:19Z</dc:date>
    <item>
      <title>Send query result by mail</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Send-query-result-by-mail/m-p/2320759#M90868</link>
      <description>&lt;P&gt;Using what is described in following link:&lt;/P&gt; 
&lt;P&gt;&lt;A href="https://community.qlik.com/s/feed/0D53p00007vCpHvCAK#M59354" target="_blank" rel="noopener"&gt;https://community.talend.com/t5/Design-and-Development/resolved-Sending-query-result-by-mail/m-p/100984#M59354&lt;/A&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I am able to send the query results by email but the email is print results column after column and not in row.&lt;/P&gt; 
&lt;P&gt;By that I mean if my table looks like this:&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Name&amp;nbsp; &amp;nbsp;Date&lt;/P&gt; 
&lt;P&gt;John&amp;nbsp; &amp;nbsp; &amp;nbsp;05-08-2019&lt;/P&gt; 
&lt;P&gt;Nas&amp;nbsp; &amp;nbsp; &amp;nbsp; 05-07-2019&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;The email that I get is this:&lt;/P&gt; 
&lt;P&gt;Name:&lt;/P&gt; 
&lt;P&gt;John&lt;/P&gt; 
&lt;P&gt;Nas&lt;/P&gt; 
&lt;P&gt;Date:&lt;/P&gt; 
&lt;P&gt;05-08-2019&lt;/P&gt; 
&lt;P&gt;05-07-2019&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;This is what I have in tjavarow:&lt;/P&gt; 
&lt;P&gt;context.StepName = context.Name+"\n"+input_row.Name;&lt;BR /&gt;context.Timestamp = context.Timestamp+"\n"+input_row.Timestamp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;And this is how the email message in tsendMail is composed:&lt;/P&gt; 
&lt;P&gt;"Name: "+context.StepName+ " Date:" + context.Timestamp+"."&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;What I would like to see in the result is each row with column header:&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Name&amp;nbsp; &amp;nbsp;Date&lt;/P&gt; 
&lt;P&gt;John&amp;nbsp; &amp;nbsp; &amp;nbsp;05-08-2019&lt;/P&gt; 
&lt;P&gt;Nas&amp;nbsp; &amp;nbsp; &amp;nbsp; 05-07-2019&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;How can I accomplish this?&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="talend_mail.PNG" style="width: 800px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M4QS.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/150063i2782A7FF5AF6C083/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M4QS.png" alt="0683p000009M4QS.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 08 May 2019 17:04:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Send-query-result-by-mail/m-p/2320759#M90868</guid>
      <dc:creator>talendstar</dc:creator>
      <dc:date>2019-05-08T17:04:19Z</dc:date>
    </item>
    <item>
      <title>Re: Send query result by mail</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Send-query-result-by-mail/m-p/2320760#M90869</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; Your email component is called after tjavarow data processing using on SubJob Ok.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So the context.StepName is havig data as below&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Name:
John
Nas&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;since you have given the code as shown below. It means, the data of name will get continously accumulated to the StepName column one after another.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;&lt;SPAN&gt;context.StepName = context.Name+"\n"+input_row.Name;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;Instead of this, you can do a simple trick.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Assign the initial value of context.Step as shown below.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;context.Step="Name"+"\t"+"Date";&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;Inside tjavarow, add as below.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;context.Step= context.Step+"\n"+input_row.Name+"\t"+input_row.Timestamp;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;Then, use the context.Step inside your existing tSendmail (which is connected using OnSubJobOk). This should reslve your issue &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Warm Regards,&lt;BR /&gt;Nikhil Thampi&lt;/P&gt;
&lt;P&gt;Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 May 2019 17:53:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Send-query-result-by-mail/m-p/2320760#M90869</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-05-08T17:53:08Z</dc:date>
    </item>
    <item>
      <title>Re: Send query result by mail</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Send-query-result-by-mail/m-p/2320761#M90870</link>
      <description>&lt;P&gt;That worked.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help.&lt;/P&gt;</description>
      <pubDate>Wed, 08 May 2019 18:29:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Send-query-result-by-mail/m-p/2320761#M90870</guid>
      <dc:creator>talendstar</dc:creator>
      <dc:date>2019-05-08T18:29:19Z</dc:date>
    </item>
    <item>
      <title>Re: Send query result by mail</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Send-query-result-by-mail/m-p/2320762#M90871</link>
      <description>&lt;P data-unlink="true"&gt;Hi&amp;nbsp;&lt;SPAN class="UserName lia-user-name lia-user-rank-Employee lia-component-message-view-widget-author-username"&gt;&lt;SPAN class=""&gt;nikhilthampi,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P data-unlink="true"&gt;&lt;SPAN&gt;I followed your explanation for that post, but got slighlty differnt results than wanted.&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P data-unlink="true"&gt;&lt;SPAN&gt;instead of geting all query results in the mail i only get the last row.&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P data-unlink="true"&gt;&lt;SPAN&gt;I guess tjava overright the context var each time, but dont know how to fix that.&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P data-unlink="true"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P data-unlink="true"&gt;&lt;SPAN&gt;This is the Log before Javarow:&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P data-unlink="true"&gt;&lt;SPAN&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.JPG" style="width: 400px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M8mV.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/139170i6AC53135801A7878/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M8mV.jpg" alt="0683p000009M8mV.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P data-unlink="true"&gt;&lt;SPAN&gt;JavaRow:&lt;/SPAN&gt;&lt;/P&gt; 
&lt;PRE&gt;context.header="player_id"+"\t"+"Alert"+"\t"+"timecreated";
context.output=context.header+"\n"+input_row.player_id+"\t"+input_row.Alert+"\t"+input_row.timecreated;&lt;/PRE&gt; 
&lt;P data-unlink="true"&gt;&lt;SPAN&gt;tSendMail:&lt;/SPAN&gt;&lt;/P&gt; 
&lt;PRE&gt;context.output&lt;/PRE&gt; 
&lt;P data-unlink="true"&gt;&lt;SPAN&gt;and that is what i get in mail:&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P data-unlink="true"&gt;&lt;SPAN&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture2.JPG" style="width: 400px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M8vH.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/155179iFD19BB5EFE8E5450/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M8vH.jpg" alt="0683p000009M8vH.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;only 1 line&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P data-unlink="true"&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P data-unlink="true"&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P data-unlink="true"&gt;&lt;SPAN&gt;this is the full Job:&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P data-unlink="true"&gt;&lt;SPAN&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture3.JPG" style="width: 576px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M8sY.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/156472i78DCC58AFCA914D3/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M8sY.jpg" alt="0683p000009M8sY.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jan 2020 17:06:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Send-query-result-by-mail/m-p/2320762#M90871</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-01-28T17:06:57Z</dc:date>
    </item>
  </channel>
</rss>

