<?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 Re: tFileInputMail - rename multiple attachments (subject to flow/iterate) in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/tFileInputMail-rename-multiple-attachments-subject-to-flow/m-p/2318203#M88569</link>
    <description>Yes, but I need to read the subject from each email individually to rename each file. That is the real issue 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MA9p.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/138034i5F552429DA646D6F/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MA9p.png" alt="0683p000009MA9p.png" /&gt;&lt;/span&gt; 
&lt;BR /&gt; 
&lt;BR /&gt;V</description>
    <pubDate>Fri, 24 Nov 2017 09:53:25 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-11-24T09:53:25Z</dc:date>
    <item>
      <title>tFileInputMail - rename multiple attachments (subject to flow/iterate)</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tFileInputMail-rename-multiple-attachments-subject-to-flow/m-p/2318199#M88565</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I'm trying to rename file attachments from email files, pulled with tFileInputMail (from tPop), based on the subject line.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I found this:&amp;nbsp;&lt;A href="https://community.qlik.com/s/feed/0D53p00007vCqv6CAC" target="_blank" rel="nofollow noopener noreferrer"&gt;https://community.talend.com/t5/Design-and-Development/Save-and-Rename-mail-attachments/td-p/112143&lt;/A&gt;&lt;/P&gt; 
&lt;P&gt;However I can't see the images that contain the solution and I am a bit lost on how to pass the values to tFileCopy (tJavaRow before to change name).&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I'm thinking something like:&lt;/P&gt; 
&lt;P&gt;tPop ---- iterate ---&amp;gt; tFileInputMail --- (row) ---&amp;gt; tJavaRow -----&amp;gt; tFlowtoIterate ----&amp;gt; tFileCopy&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;But I can't extract/pass the attachment name from tFileInputMail.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Thanks.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Regards,&lt;/P&gt; 
&lt;P&gt;V&lt;/P&gt;</description>
      <pubDate>Wed, 22 Nov 2017 23:24:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tFileInputMail-rename-multiple-attachments-subject-to-flow/m-p/2318199#M88565</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-11-22T23:24:52Z</dc:date>
    </item>
    <item>
      <title>Re: tFileInputMail - rename multiple attachments (subject to flow/iterate)</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tFileInputMail-rename-multiple-attachments-subject-to-flow/m-p/2318200#M88566</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When you retrieve the attachment files using the tFileInputMail you specify the folder Path and not the File attachment name.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So in your case, you can develop 2 subjobs :&lt;/P&gt;&lt;P&gt;1- Retrieve the attachments files and put them in the folder.&lt;/P&gt;&lt;P&gt;2- Use tFilelist to fetch the folder and in each iteration you can uste tCopy to rename the files.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;</description>
      <pubDate>Thu, 23 Nov 2017 16:13:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tFileInputMail-rename-multiple-attachments-subject-to-flow/m-p/2318200#M88566</guid>
      <dc:creator>med1</dc:creator>
      <dc:date>2017-11-23T16:13:17Z</dc:date>
    </item>
    <item>
      <title>Re: tFileInputMail - rename multiple attachments (subject to flow/iterate)</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tFileInputMail-rename-multiple-attachments-subject-to-flow/m-p/2318201#M88567</link>
      <description>Hi,
&lt;BR /&gt;
&lt;BR /&gt;Thanks for your reply. I had gotten close to that, but I still don't know how to pass/use the subject to generate the new filename.
&lt;BR /&gt;
&lt;BR /&gt;Should I just use a tjavarow?
&lt;BR /&gt;
&lt;BR /&gt;tFileInputMail -&amp;gt; tjavarow -&amp;gt; tfilelist -&amp;gt; tfilecopy
&lt;BR /&gt;
&lt;BR /&gt;Just sounds super complicated for a simple operation. But maybe it is the best way.
&lt;BR /&gt;
&lt;BR /&gt;Cheers,
&lt;BR /&gt;V</description>
      <pubDate>Fri, 24 Nov 2017 09:25:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tFileInputMail-rename-multiple-attachments-subject-to-flow/m-p/2318201#M88567</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-11-24T09:25:19Z</dc:date>
    </item>
    <item>
      <title>Re: tFileInputMail - rename multiple attachments (subject to flow/iterate)</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tFileInputMail-rename-multiple-attachments-subject-to-flow/m-p/2318202#M88568</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In fact&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;tFileInputMail allow you to retrieve the File in specific folder (you specify the folder).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;you can use directly :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;tFileInputMail (On component OK) -&amp;gt; tfilelist (specify the folder which contain the files) -&amp;gt; tfilecopy&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;No need to use tJavaRow.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BR,&lt;/P&gt;
&lt;P&gt;Med&lt;/P&gt;</description>
      <pubDate>Fri, 24 Nov 2017 09:30:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tFileInputMail-rename-multiple-attachments-subject-to-flow/m-p/2318202#M88568</guid>
      <dc:creator>med1</dc:creator>
      <dc:date>2017-11-24T09:30:40Z</dc:date>
    </item>
    <item>
      <title>Re: tFileInputMail - rename multiple attachments (subject to flow/iterate)</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tFileInputMail-rename-multiple-attachments-subject-to-flow/m-p/2318203#M88569</link>
      <description>Yes, but I need to read the subject from each email individually to rename each file. That is the real issue 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MA9p.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/138034i5F552429DA646D6F/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MA9p.png" alt="0683p000009MA9p.png" /&gt;&lt;/span&gt; 
&lt;BR /&gt; 
&lt;BR /&gt;V</description>
      <pubDate>Fri, 24 Nov 2017 09:53:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tFileInputMail-rename-multiple-attachments-subject-to-flow/m-p/2318203#M88569</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-11-24T09:53:25Z</dc:date>
    </item>
    <item>
      <title>Re: tFileInputMail - rename multiple attachments (subject to flow/iterate)</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tFileInputMail-rename-multiple-attachments-subject-to-flow/m-p/2318204#M88570</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ok i get what you need.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So the idea is to retrieve in each iteration the subject and then use this subject to rename your files.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;so you can use tFileinputMail (iterate)==&amp;gt;tJava(iterate)==&amp;gt;tFilelist==&amp;gt;tCopy&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;beause you cant use tJavaRow in iterate.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;GoodLuck&lt;/P&gt;</description>
      <pubDate>Fri, 24 Nov 2017 10:32:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tFileInputMail-rename-multiple-attachments-subject-to-flow/m-p/2318204#M88570</guid>
      <dc:creator>med1</dc:creator>
      <dc:date>2017-11-24T10:32:18Z</dc:date>
    </item>
    <item>
      <title>Re: tFileInputMail - rename multiple attachments (subject to flow/iterate)</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tFileInputMail-rename-multiple-attachments-subject-to-flow/m-p/2318205#M88571</link>
      <description>&lt;P&gt;OK, so nearly there.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Question, how do I access the subject in tJava?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks for your time, and help so far&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;V&lt;/P&gt;</description>
      <pubDate>Fri, 24 Nov 2017 11:12:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tFileInputMail-rename-multiple-attachments-subject-to-flow/m-p/2318205#M88571</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-11-24T11:12:57Z</dc:date>
    </item>
    <item>
      <title>Re: tFileInputMail - rename multiple attachments (subject to flow/iterate)</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tFileInputMail-rename-multiple-attachments-subject-to-flow/m-p/2318206#M88572</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I try to access to the subject using tJava but no way (the variables are not available for this component).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try to use tFlowIterate ( tFileInputMail (main_row)==&amp;gt;tFlowIterate(titerate)==&amp;gt;tCopyFile&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let me know if it works.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Nov 2017 14:05:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tFileInputMail-rename-multiple-attachments-subject-to-flow/m-p/2318206#M88572</guid>
      <dc:creator>med1</dc:creator>
      <dc:date>2017-11-24T14:05:01Z</dc:date>
    </item>
    <item>
      <title>Re: tFileInputMail - rename multiple attachments (subject to flow/iterate)</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tFileInputMail-rename-multiple-attachments-subject-to-flow/m-p/2318207#M88573</link>
      <description>&lt;P&gt;Hi med,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Many thanks for your help. I've finally got back to this and have cracked it with your help/guidance.&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I now have it working with (after pulling all emails into a folder):&lt;/P&gt; 
&lt;P&gt;tFileList -(iterate)-&amp;gt; tFileInputMail -(row)&amp;gt; tJavaRow -&amp;gt; onComponentOK -&amp;gt; tFileList -&lt;SPAN&gt;(iterate)-&lt;/SPAN&gt;&amp;gt; tFileCopy&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;*onComponentOk can be replaced with -(row)&amp;gt; tFlowtoIterate -&lt;SPAN&gt;(iterate)-&amp;gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;tJavaCode:&amp;nbsp;&lt;EM&gt;globalMap.put("subject",row1.subject)&lt;/EM&gt;&lt;/P&gt; 
&lt;P&gt;tFileCopy:&lt;/P&gt; 
&lt;UL&gt; 
 &lt;LI&gt;Rename - Destination filename =&amp;nbsp;(String)globalMap.get("subject")+".csv"&lt;/LI&gt; 
 &lt;LI&gt;Remove Source File&lt;/LI&gt; 
&lt;/UL&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Note: we have to use tJavaRow because "&lt;EM&gt;Where is tJava used in the Job design: The Java code inserted through the tJava is executed first but only once in the subjob&lt;/EM&gt;" - so we couldn't read the initial row value.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Regards,&lt;/P&gt; 
&lt;P&gt;Vitor Lopes&lt;/P&gt;</description>
      <pubDate>Wed, 06 Dec 2017 16:25:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tFileInputMail-rename-multiple-attachments-subject-to-flow/m-p/2318207#M88573</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-12-06T16:25:16Z</dc:date>
    </item>
  </channel>
</rss>

