function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SurajCovelixSurajCovelix 

Migrating rtf format fields into Salesforce

We are in the middle of a Data Migration. Our legacy database has columns of rtf format. I need to migrate this field to Salesforce preserving the original formatting and stylling. At the moment, it takes all as plain text. How can this be done?

Hengky IlawanHengky Ilawan

Hi,

 

I assume you are using Rich Text Area field type as the destination in Salesforce.

Maybe you can convert the RTF columns to HTML first before importing them into Salesforce. Rich Text Area field can take HTML format.

 

Regards,

Hengky

SurajCovelixSurajCovelix

Yes Hengky, I have a Rich Text Area field in sfdc. I got a Java code snippet here(RTF to HTML) which converts rtf format into html. Now I will try to insert this generated html as a value to the Rich Text Field in Salesforce.

SurajCovelixSurajCovelix

When I migrate the generated(html) data in the rich text field, it goes as plain text. But hyperlinks or emails also go as plain text which is unexpected. So any idea how to get the rich formatting right there?

Hengky IlawanHengky Ilawan

How did you do the migration?

What tool did you use to import the data into sfdc?

 

Regards,

Hengky

SurajCovelixSurajCovelix

I am using Apex Data Loader latest version.

Hengky IlawanHengky Ilawan

Apex Data Loader should be able to handle it correctly.

Could you provide more information, please?

Maybe some sample lines from your CSV.

 

Regards,

Hengky

SurajCovelixSurajCovelix

I have the same above mentioned Java program process the rtf formatand convert it to html for me. This hml goes to the data spreadsheet which I will be using to insert records in salesforce. I salesforce, that field has text value(removing all html tags). Its okay as a plain text but the formatting or highlighting is missing. For example,

Original rtf data :

{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fswiss\fprq2\fcharset0 MS Sans Serif;}{\f1\fnil\fprq9\fcharset0 Arial;}}  {\colortbl ;\red0\green0\blue0;}  {\*\generator Msftedit 5.41.15.1507;}\viewkind4\uc1\pard\cf1\b\f0\fs16 john@abc.com > e-mail undeliverable 11.16.10\cf0\f1\fs20\par  } 

 

After conversion using the code :

  <head>
    <style>
      <!--
      -->
    </style>
  </head>
  <body>
    <p class="default">
      <span style="color: #000000">
          
      </span>
        <span style="color: #000000; font-size: 8pt; font-family: MS Sans Serif">
<b>john@abc.com> e-mail undeliverable 12.19.08</b>
      </span>
      <span style="color: #000000; font-size: 10pt; font-family: Arial">
        <b></b>
      </span>
    </p>
    <p class="default">
      <span style="color: #000000; font-size: 10pt; font-family: Arial">
        <b> </b>
      </span>
    </p>
  </body>
</html>

 

 

In SFDC :

john@abc.com> e-mail undeliverable 12.19.08

No formatting or hyperlink

Hengky IlawanHengky Ilawan

Hi,

 

HTML link should use the <A> tag. 

There is no <A> tag in the HTML that you provided.

I tried importing the HTML into my developer org and I can see the line is formatted as bold.

Please check the HTML.

 

Anyway,

You can try to manually query to your object just to verify if your HTML was imported correctly.

Double click on the salesforce.schema if you use eclipse. Or use the developer console and system.debug to output the field value.

 

Regards,

Hengky

SurajCovelixSurajCovelix

The field value is a plain text :

john@abc.com> e-mail undeliverable 12.19.08

and yes its bold because of the <b> tag there. But its no hyperlink as one would expect.

Hengky IlawanHengky Ilawan
You need to check the rtf converter then.

Regards,
Hengky
raja4sfdc1.3926329391359482E12raja4sfdc1.3926329391359482E12
Hi,

I'm new to data loading and facing the same issue, after converting the file from RTF to html also the data is not getting populated in a proper format.
Can someone help me in this regard, and what converter we need to use.

Thanks in advance.