Text fields are truncated when exporting or importing
|Knowledge Article Number||000239669|
|Description||When I export with Data Loader for example and then open the resulting file in Excel long text field data is being truncated.
The issue may seem random because it's not occurring for all records or long text fields however, it should be consistent for affected records and fields. Some records containing data in the same field may not be truncated and if you export from a report, the field's data may be complete.
This issue is not due to Salesforce and is instead unique to Excel and the way it interprets the first character contained in the affected record's text field.
This is known to occur if the field's data contains a minus sign "-" or other character such as an at symbol "@" at the beginning of the affected field's data. In fact, Excel is easily able to handle more than 255 characters however, in this circumstance Excel is trying to interpret the "-" minus or "@" at signs as part of a formula which is then automatically causing the text to follow to be truncated to a 255 character limit.
|Resolution||Potential workarounds to this Excel behavior:
A) Remove the first - or @ signs from the affected field's data, or add a space at the very beginning of the affected field data before the sign.
If you want to mass update your file, please follow this work around.
1. Open CSV file with Notepad or any text editor
2. Run a find and replace for the following criteria:
This way Excel will know this is text and not a formula and it will be able to properly represent it within the worksheet.
B) Use an alternative program instead of Excel such as Notepad++ for example to modify and save your CSV files.