Skip to content

Conversation

vdub405
Copy link

@vdub405 vdub405 commented Sep 12, 2025

This update enhances the robustness and functionality of the CSV to SObject conversion for Salesforce Flows. Key improvements include:

  1. BOM Handling: Removes Byte Order Mark (BOM) characters from CSV headers to prevent parsing errors.
  2. Field Label Support: Supports CSV headers using field labels in addition to API names, with automatic mapping.
  3. ID Flexibility: Automatically detects and handles both ContentVersion and ContentDocument IDs.
  4. Error Handling: Added comprehensive try-catch blocks and null checks to prevent NullPointerExceptions and handle corrupted files gracefully.
  5. Data Type Fixes: Corrected casing issues (e.g., convertedfieldValue to convertedFieldValue, date.valueOf to Date.valueOf).
  6. Exception Safety: Used String.valueOf() in exception messages to avoid secondary NPEs.
  7. Robust Parsing: Improved CSV blob to string conversion with fallbacks for encoding issues.

These changes make the component more reliable for bulk uploads, especially with user-generated CSV files that may have encoding issues or use field labels.

- Add BOM removal from CSV headers
- Support field labels in addition to API names
- Automatic detection of ContentVersion vs ContentDocument IDs
- Comprehensive error handling and null checks
- Fix casing and method call issues
- Prevent NPEs in exception messages
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant