1

1, Using Data loader, can we import Rich Text Area field value as a html file from local folder? Like below

Step_by_Step__c

C:\Users\data\Passport_Valid.html

  1. the above html file contains image in the format of base64. if we import the html file then base64 will be converted automatically in to image?

Please help me on the above questions

1

Data with HTML format can be rendered by fields having a Text Area (Rich) Data Type. Mapping HTML data to a non Rich-Text Area field may result to an error or the raw data being imported. To prepare the Data you would need to create a CSV with the Rich text field as one of its Column:

  1. Create a CSV file with one column header that will be mapped to a Rich Text Field.
  2. On this column enter the full HTML code that you wish to upload on the cell.
  3. Use Data Import Wizard or Data Loader

For more information please look into below knowledge article. Export or import Data Rich Text Area field with HTML formatting

| improve this answer | |
  • I able to upload and render If i use raw html code in the csv cell but the problem is csv cell has an limitation 32k characters. i have more than 32k characters which i need to import. I have tried using html file path but i ended with importing raw data(in this case the html file path) – user51204 Jun 7 '18 at 23:40
  • Aah, Then I have to leave it to the rest of the community. – codeyinthecloud Jun 7 '18 at 23:57
1

You may upload html file using Salesforce Files and then query its data as Blob and convert into String using toString method.

List<ContentVersion> cvs = [
   SELECT Id, VersionData
   FROM ContentVersion
   WHERE ContentDocumentId = '<your document id>'];
String htmlData = cvs[0].VersionData.toString();
System.debug(htmlData); //you can save it as Rich Text as well
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.