fix(CSV import): error while using a column as row id #1514
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
User's issue:
User have reported an issue with batch importing CSV files when selecting a custom column for Document IDs. Although importing the same CSV with auto-generated Document IDs works, choosing a specific column as Document IDs leads to an error: "n.charAt is not a function."
Cause:
Column types like reference and image, require custom parsers. Previously, these parsers were stored in an object with the column index as the key. However, when using a custom document ID, the explicit setting of the document ID resulted in a change to the column index reference.
Fix:
The fix involves using the column key as the key to store the parsers, rather than relying on the column index.