<?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: [resolved] Upload Attachment into Salesforce in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/resolved-Upload-Attachment-into-Salesforce/m-p/2300034#M72308</link>
    <description>Hi,&lt;BR /&gt;Talend is a developer tool requiring technical skill, not an end user tool.&lt;BR /&gt;Data Loader is helpfull but cannot do what Talend can.&lt;BR /&gt;Regards,&lt;BR /&gt;TRF</description>
    <pubDate>Fri, 26 Aug 2016 15:52:20 GMT</pubDate>
    <dc:creator>TRF</dc:creator>
    <dc:date>2016-08-26T15:52:20Z</dc:date>
    <item>
      <title>[resolved] Upload Attachment into Salesforce</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Upload-Attachment-into-Salesforce/m-p/2300029#M72303</link>
      <description>Hi. Im trying to upload set of files into Salesforce using tSalesforceOutput. I understand I need to use file where following columns are required 
&lt;BR /&gt; 
&lt;BR /&gt;ParentId&amp;nbsp;- the Salesforce ID of the parent record. 
&lt;BR /&gt;Name&amp;nbsp;- the name of the attachment file, such as&amp;nbsp;myattachment.jpg. 
&lt;BR /&gt;Body&amp;nbsp;- the absolute path to the attachment on your local drive 
&lt;BR /&gt;I upload the file and check the salesforce record, there is indeed the file loaded with the name specified in the sheet but when I try to open it.. it is just nothing (check the second picture attached). On the first picture you can see the job in Talend, last picture is the file specifying the attachment path and details.&amp;nbsp;Can anyone help please? Many thanks 
&lt;BR /&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MBIO.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/147912i4F7169B8EE242589/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MBIO.png" alt="0683p000009MBIO.png" /&gt;&lt;/span&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MBP4.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/127719iF0426A4E482D4F5A/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MBP4.png" alt="0683p000009MBP4.png" /&gt;&lt;/span&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MBOv.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/137910i9C1E35FBE2023DB0/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MBOv.png" alt="0683p000009MBOv.png" /&gt;&lt;/span&gt;</description>
      <pubDate>Sat, 16 Nov 2024 10:25:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Upload-Attachment-into-Salesforce/m-p/2300029#M72303</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T10:25:54Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Upload Attachment into Salesforce</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Upload-Attachment-into-Salesforce/m-p/2300030#M72304</link>
      <description>Hi,&lt;BR /&gt;To load attchments to Salesforce, you need to convert the file to Base64 using a tJavaRow component.&lt;BR /&gt;The conversion result must be used to populates the Body field.&lt;BR /&gt;Google is your friend to find examples for the conversion routine.&lt;BR /&gt;Regards,&lt;BR /&gt;TRF</description>
      <pubDate>Wed, 24 Aug 2016 20:19:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Upload-Attachment-into-Salesforce/m-p/2300030#M72304</guid>
      <dc:creator>TRF</dc:creator>
      <dc:date>2016-08-24T20:19:16Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Upload Attachment into Salesforce</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Upload-Attachment-into-Salesforce/m-p/2300031#M72305</link>
      <description>Thanks. Unfortunately Im no coder and my friend Google returns some code stuff only.. could you guide me through please? from what I understand I need to use tJavaRow and write something like this below?&lt;BR /&gt;output_row.ParentId = input_row.ParentId;&lt;BR /&gt;output_row.Name = input_row.Name;&lt;BR /&gt;output_row.Body = input_row.Body;&lt;BR /&gt;String s = &lt;B&gt;new&lt;/B&gt; Base64.encodeBase64(input_row.Body);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; output_row.Body = s;&lt;BR /&gt;It doesnt work however, Im getting error "Base64 cannot be resolved to a type" and I guess I need to import some library as well? dont know how but thats what I see on forums</description>
      <pubDate>Thu, 25 Aug 2016 11:41:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Upload-Attachment-into-Salesforce/m-p/2300031#M72305</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-08-25T11:41:01Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Upload Attachment into Salesforce</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Upload-Attachment-into-Salesforce/m-p/2300032#M72306</link>
      <description>Hi, 
&lt;BR /&gt;Yes, you need to code a little for such a case. 
&lt;BR /&gt;Here is an example of what the tJavaRow should look like to accomplish the file conversion: 
&lt;BR /&gt; 
&lt;PRE&gt;output_row.Parent_ID = input_row.Parent_ID; // Related object's Id&lt;BR /&gt;output_row.Name = input_row.Name; // The document's name such as xxxxx.docx or yyyyyy.xlsx or anything else &lt;BR /&gt;output_row.ContentType = input_row.ContentType; // Object's name such as Account, Task and so on&lt;BR /&gt;output_row.Body = null; // The place to put the conversion result&lt;BR /&gt;// In this case, I iterate over the input directory using a tFileList&lt;BR /&gt;File file = new File((String)globalMap.get("tFileList_1_CURRENT_FILEPATH"));&lt;BR /&gt;try {           &lt;BR /&gt;    // Read file&lt;BR /&gt;    documentInFile = new FileInputStream(file);&lt;BR /&gt;    byte documentData[] = new byte;&lt;BR /&gt;    documentInFile.read(documentData);&lt;BR /&gt;    // Convert bytes array to Base64 string to fill Body field&lt;BR /&gt;    output_row.Body = new String(Base64.encodeBase64(documentData));&lt;BR /&gt;    System.out.println("+++ File converted "+(String)globalMap.get("tFileList_1_CURRENT_FILEPATH"));&lt;BR /&gt;} catch (FileNotFoundException e) {&lt;BR /&gt;    output_row.conversionCode = "FILE_NOT_FOUND";&lt;BR /&gt;    output_row.conversionMessage = "File not found "+(String)globalMap.get("tFileList_1_CURRENT_FILEPATH");&lt;BR /&gt;    System.out.println("*** File not found "+(String)globalMap.get("tFileList_1_CURRENT_FILEPATH")+"\n"+e);&lt;BR /&gt;} catch (IOException ioe) {&lt;BR /&gt;    output_row.conversionCode = "CONVERSION_ERROR";&lt;BR /&gt;    output_row.conversionMessage = "Error converting file "+(String)globalMap.get("tFileList_1_CURRENT_FILEPATH");&lt;BR /&gt;    System.out.println("*** Error converting file "+(String)globalMap.get("tFileList_1_CURRENT_FILEPATH")+"\n"+ioe);&lt;BR /&gt;} finally {&lt;BR /&gt;    try {&lt;BR /&gt;       // Close and delete file after it has been successfully converted&lt;BR /&gt;       if (documentInFile != null) {&lt;BR /&gt;          documentInFile.close();&lt;BR /&gt;          file.delete();&lt;BR /&gt;       }&lt;BR /&gt;    } catch (IOException e) {&lt;BR /&gt;          output_row.conversionCode = "DELETE_ERROR";&lt;BR /&gt;          output_row.conversionMessage = "Error deleting file "+(String)globalMap.get("tFileList_1_CURRENT_FILEPATH");&lt;BR /&gt;          System.out.println("*** Error deleting file "+(String)globalMap.get("tFileList_1_CURRENT_FILEPATH")+"\n"+e);&lt;BR /&gt;          e.printStackTrace();&lt;BR /&gt;    }&lt;BR /&gt;}&lt;BR /&gt;&lt;/PRE&gt; 
&lt;BR /&gt;In the Advanced setting of tJavaRow, you must import required librairies: 
&lt;BR /&gt; 
&lt;PRE&gt;import java.io.File;&lt;BR /&gt;import java.io.FileInputStream;&lt;BR /&gt;import java.io.FileNotFoundException;&lt;BR /&gt;import java.io.FileOutputStream;&lt;BR /&gt;import java.io.IOException;&lt;BR /&gt;// Import de Apache Commons Codec for Base64 conversion of documents&lt;BR /&gt;import org.apache.commons.codec.binary.Base64;&lt;/PRE&gt; 
&lt;BR /&gt;And a minimalistic job should look like this one: 
&lt;BR /&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MBP9.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/145775i442E7D87AC74576D/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MBP9.png" alt="0683p000009MBP9.png" /&gt;&lt;/span&gt; 
&lt;BR /&gt;Regards, 
&lt;BR /&gt;TRF</description>
      <pubDate>Thu, 25 Aug 2016 15:39:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Upload-Attachment-into-Salesforce/m-p/2300032#M72306</guid>
      <dc:creator>TRF</dc:creator>
      <dc:date>2016-08-25T15:39:45Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Upload Attachment into Salesforce</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Upload-Attachment-into-Salesforce/m-p/2300033#M72307</link>
      <description>Ok thanks, resolved by using Apex Data Loader though. The solution above works however it is not very well handled by Talend, technically you cannot load files into salesforce without having dev skills, so it is not very useful to business or less technical skilled users. At least if there was a component doing this base64 encoding itself would be very helpful. Thanks anyway</description>
      <pubDate>Fri, 26 Aug 2016 15:08:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Upload-Attachment-into-Salesforce/m-p/2300033#M72307</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-08-26T15:08:55Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Upload Attachment into Salesforce</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Upload-Attachment-into-Salesforce/m-p/2300034#M72308</link>
      <description>Hi,&lt;BR /&gt;Talend is a developer tool requiring technical skill, not an end user tool.&lt;BR /&gt;Data Loader is helpfull but cannot do what Talend can.&lt;BR /&gt;Regards,&lt;BR /&gt;TRF</description>
      <pubDate>Fri, 26 Aug 2016 15:52:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Upload-Attachment-into-Salesforce/m-p/2300034#M72308</guid>
      <dc:creator>TRF</dc:creator>
      <dc:date>2016-08-26T15:52:20Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Upload Attachment into Salesforce</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Upload-Attachment-into-Salesforce/m-p/2300035#M72309</link>
      <description>You&amp;nbsp;can&amp;nbsp;actually achieve this without diving deep into Java programming. Please evaluate the tFileInputRaw component. Connect this via a tMap to tSalesforceOutput and as the value for the Body field in the Salesforce schema, use a Base64 encode method like described above (e.g. "new org.apache.commons.codec.binary.Base64.encodeBase64("row1.content")"). But please be aware that TOS 6.2.1 had an issue with uploading attachments to Salesforce in general. It may only be possible in one of the upcoming versions (&amp;gt; 6.2.1).</description>
      <pubDate>Tue, 30 Aug 2016 15:23:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Upload-Attachment-into-Salesforce/m-p/2300035#M72309</guid>
      <dc:creator>JR1</dc:creator>
      <dc:date>2016-08-30T15:23:51Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Upload Attachment into Salesforce</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Upload-Attachment-into-Salesforce/m-p/2300036#M72310</link>
      <description>&lt;P&gt;&amp;nbsp;In the job design shown , file list is directly connected to sleep and then to java row, how is the file read here?&lt;/P&gt;</description>
      <pubDate>Thu, 20 Sep 2018 10:25:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Upload-Attachment-into-Salesforce/m-p/2300036#M72310</guid>
      <dc:creator>sarath2</dc:creator>
      <dc:date>2018-09-20T10:25:30Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Upload Attachment into Salesforce</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Upload-Attachment-into-Salesforce/m-p/2300037#M72311</link>
      <description>&lt;P&gt;tSleep is here to permit the connection between tFileList and tJavaRow (was developed for TOS 6.2.1)&lt;/P&gt; 
&lt;P&gt;In recent versions of TOS this design is not permitted anymore as tSleep must have an input flow to have an output flow.&lt;/P&gt; 
&lt;P&gt;So the design must be revisited.&lt;/P&gt; 
&lt;P&gt;However, using Attachment is not a best practice from a salesforce point of view.&lt;/P&gt; 
&lt;P&gt;You should consider using Files instead.&lt;/P&gt; 
&lt;P&gt;Unfortunately, tSalesforceOutputXxxx components are not able to deal with ContentVersion object (see this post&amp;nbsp;&lt;A href="https://community.qlik.com/s/feed/0D73p000004kV6lCAE#M83900" target="_blank"&gt;https://community.talend.com/t5/Design-and-Development/Upload-content-files-into-Salesforce-using-ContentVersion-object/m-p/134590#M83900&lt;/A&gt;).&lt;/P&gt; 
&lt;P&gt;For now, the solution is to use DataLoader in script mode, driving operations from Talend.&lt;/P&gt; 
&lt;P&gt;If this is a subject for you and have any question, please open an other topic.&lt;/P&gt; 
&lt;P&gt;Good luck!&lt;/P&gt;</description>
      <pubDate>Thu, 20 Sep 2018 10:40:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Upload-Attachment-into-Salesforce/m-p/2300037#M72311</guid>
      <dc:creator>TRF</dc:creator>
      <dc:date>2018-09-20T10:40:39Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Upload Attachment into Salesforce</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Upload-Attachment-into-Salesforce/m-p/2300038#M72312</link>
      <description>&lt;P&gt;it does not work at all&amp;nbsp; any update ???&lt;/P&gt;</description>
      <pubDate>Fri, 13 Dec 2019 15:29:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Upload-Attachment-into-Salesforce/m-p/2300038#M72312</guid>
      <dc:creator>abdelhamed</dc:creator>
      <dc:date>2019-12-13T15:29:12Z</dc:date>
    </item>
  </channel>
</rss>

