<?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: Download file from Salesforce using API in Product Forum</title>
    <link>https://community.blueprism.com/t5/Product-Forum/Download-file-from-Salesforce-using-API/m-p/87589#M38281</link>
    <description>Dim binaryData() as byte = convert.FromBase64String(Base64Str)&lt;BR /&gt;Dim fs as new fileStream (Filepath, FileMode.CreateNew)&lt;BR /&gt;&lt;BR /&gt;fs.Write(binaryData,0,binarydata.Length)&lt;BR /&gt;&lt;BR /&gt;fs.close&lt;BR /&gt;&lt;BR /&gt;Use this code, Base64Str is your base 64 String, filepath should be entire file path where you want to save file, like c:/temp.pdf or d:/new.txt , i hope you know the extention.&lt;BR /&gt;You can put this in a code stage and run it, it works fine. you will have to import&amp;nbsp;Microsoft.VisualBasic name space in object.&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Ishan Mahajan &lt;BR /&gt;India&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
    <pubDate>Tue, 21 Jul 2020 14:15:00 GMT</pubDate>
    <dc:creator>IshanMahajan</dc:creator>
    <dc:date>2020-07-21T14:15:00Z</dc:date>
    <item>
      <title>Download file from Salesforce using API</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Download-file-from-Salesforce-using-API/m-p/87587#M38279</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;I would like some advice regarding how to download a file from Salesforce to local folder.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I'm using the BP Skill "Salesforce" to obtain the ContentDocumentId.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt; I use the following "GET" API to retrieve&amp;nbsp;the base-64 from Salesforce&lt;BR /&gt;&lt;BR /&gt;/services/data/v47.0/sobjects/ContentVersion/[Id]/VersionData&lt;BR /&gt;&lt;BR /&gt;I'm stuck with how to convert the response content to a physical file.&lt;BR /&gt;&lt;BR /&gt;I figure I have to use the code stage to convert the data, but I'm not quite sure how to achieve it.&lt;BR /&gt;Any help would be highly appreciated.&lt;BR /&gt;&lt;BR /&gt;Best Regards&lt;BR /&gt;&lt;BR /&gt;Met Vonghiran&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Met Vonghiran&lt;BR /&gt;Consultant&lt;BR /&gt;Deloitte&lt;BR /&gt;Asia/Tokyo&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Mon, 20 Jul 2020 14:05:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Download-file-from-Salesforce-using-API/m-p/87587#M38279</guid>
      <dc:creator>MetVonghiran</dc:creator>
      <dc:date>2020-07-20T14:05:00Z</dc:date>
    </item>
    <item>
      <title>RE: Download file from Salesforce using API</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Download-file-from-Salesforce-using-API/m-p/87588#M38280</link>
      <description>hello Met,&lt;BR /&gt;&lt;BR /&gt;sample google search -&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;A href="https://bytes.com/topic/visual-basic-net/answers/362824-convert-base64-string-file" target="test_blank"&gt;https://bytes.com/topic/visual-basic-net/answers/362824-convert-base64-string-file&lt;/A&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Ashish Easow&lt;BR /&gt;Senior Consultant - Professional Services&lt;BR /&gt;Blueprism&lt;BR /&gt;Asia/Kolkata&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Tue, 21 Jul 2020 13:20:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Download-file-from-Salesforce-using-API/m-p/87588#M38280</guid>
      <dc:creator>ashish.easow</dc:creator>
      <dc:date>2020-07-21T13:20:00Z</dc:date>
    </item>
    <item>
      <title>RE: Download file from Salesforce using API</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Download-file-from-Salesforce-using-API/m-p/87589#M38281</link>
      <description>Dim binaryData() as byte = convert.FromBase64String(Base64Str)&lt;BR /&gt;Dim fs as new fileStream (Filepath, FileMode.CreateNew)&lt;BR /&gt;&lt;BR /&gt;fs.Write(binaryData,0,binarydata.Length)&lt;BR /&gt;&lt;BR /&gt;fs.close&lt;BR /&gt;&lt;BR /&gt;Use this code, Base64Str is your base 64 String, filepath should be entire file path where you want to save file, like c:/temp.pdf or d:/new.txt , i hope you know the extention.&lt;BR /&gt;You can put this in a code stage and run it, it works fine. you will have to import&amp;nbsp;Microsoft.VisualBasic name space in object.&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Ishan Mahajan &lt;BR /&gt;India&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Tue, 21 Jul 2020 14:15:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Download-file-from-Salesforce-using-API/m-p/87589#M38281</guid>
      <dc:creator>IshanMahajan</dc:creator>
      <dc:date>2020-07-21T14:15:00Z</dc:date>
    </item>
    <item>
      <title>RE: Download file from Salesforce using API</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Download-file-from-Salesforce-using-API/m-p/87590#M38282</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;A id="MainCopy_ctl08_ucMessageList_rptMessageList_ProfileImageDisplay_1_NameLink_1" biobubblekey="987cc3b1-8649-4110-ba86-d7913ad19184" href="https://community.blueprism.com/people/ashish-easow1" target="_blank" rel="noopener"&gt;Ashish&lt;/A&gt;&amp;nbsp;and Ishan&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;I tried the code and it was able to create a file. This is really a big progress.&lt;/P&gt;
&lt;P&gt;However, I just realize that the result that I got from using REST API was not in base64 format (it was a raw binary).&lt;BR /&gt;Based on the discussion in the link below, I have to create a SOAP API request. If I'm able to achieve that then I could combine with the code stage that you provide to get a physical file.&lt;BR /&gt;&lt;A href="https://stackoverflow.com/questions/60283198/get-base64-data-of-file-from-salesforce" target="_blank" rel="noopener"&gt;https://stackoverflow.com/questions/60283198/get-base64-data-of-file-from-salesforce&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;I'm still new to the concept of API and how to use BluePrism to call it.&lt;BR /&gt;I will try to use Utility-HTTP to see if I could get the base64 out of Salesforce or not.&lt;/P&gt;
&lt;P&gt;Thank you so much&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Met Vonghiran&lt;BR /&gt;Consultant&lt;BR /&gt;Deloitte&lt;BR /&gt;Asia/Tokyo&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Wed, 22 Jul 2020 00:23:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Download-file-from-Salesforce-using-API/m-p/87590#M38282</guid>
      <dc:creator>MetVonghiran</dc:creator>
      <dc:date>2020-07-22T00:23:00Z</dc:date>
    </item>
  </channel>
</rss>

