Map column labels to API names and show field labels in column suggestions#1218
Open
neozhu wants to merge 6 commits into
Open
Map column labels to API names and show field labels in column suggestions#1218neozhu wants to merge 6 commits into
neozhu wants to merge 6 commits into
Conversation
…mapping Map import column labels to API names
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Motivation
Improve the Data Import field-mapping experience when users paste or type Excel/CSV headers that use Salesforce field Labels instead of API Names.
Example:
Customer SegmentationCustSegmentation__cThe import UI should be able to resolve the Label to the API Name while still keeping the mapping value as the API Name.
Summary
Relationship.ExternalId.guessColumn()so a pasted or fully typed Salesforce field Label maps back to the field API Name.labelattributes to field-mapping<option>entries while keepingvalueas the API Name.guessColumn()so manually entered Labels can be converted to API Names.Implementation Details
columnLabel(columnName)to look up the Salesforce field Label from the current sObject describe metadata.guessColumn()to:field.labelcase-insensitively,ColumnMapper.onColumnValueChange()to applymodel.guessColumn(e.target.value)when users edit a mapping field.Notes
The datalist option
valueremains the API Name, so selecting a suggestion still fills the API Name into the mapping input. Thelabelattribute is used only to expose the human-readable Salesforce field Label in the browser suggestion UI.Testing