Skip to content

Map column labels to API names and show field labels in column suggestions#1218

Open
neozhu wants to merge 6 commits into
tprouvot:mainfrom
neozhu:main
Open

Map column labels to API names and show field labels in column suggestions#1218
neozhu wants to merge 6 commits into
tprouvot:mainfrom
neozhu:main

Conversation

@neozhu

@neozhu neozhu commented Jul 2, 2026

Copy link
Copy Markdown

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:

  • Excel header: Customer Segmentation
  • Salesforce API Name: CustSegmentation__c

The import UI should be able to resolve the Label to the API Name while still keeping the mapping value as the API Name.

Summary

  • Trim column header input before guessing field mappings.
  • Preserve existing dotted external-id mapping behavior, such as Relationship.ExternalId.
  • Add case-insensitive field Label matching in guessColumn() so a pasted or fully typed Salesforce field Label maps back to the field API Name.
  • Add label attributes to field-mapping <option> entries while keeping value as the API Name.
    • Example rendered intent:
      <option value="CustSegmentation__c" label="Customer Segmentation"></option>
  • Normalize edited mapping values through guessColumn() so manually entered Labels can be converted to API Names.

Implementation Details

  • Added columnLabel(columnName) to look up the Salesforce field Label from the current sObject describe metadata.
  • Updated the field mapping datalist to render API Name options with their corresponding Label metadata.
  • Updated guessColumn() to:
    • trim the input,
    • run existing external-id matching against the trimmed value,
    • match field.label case-insensitively,
    • return the API Name when a Label match is found,
    • otherwise return the trimmed input.
  • Updated ColumnMapper.onColumnValueChange() to apply model.guessColumn(e.target.value) when users edit a mapping field.

Notes

The datalist option value remains the API Name, so selecting a suggestion still fills the API Name into the mapping input. The label attribute is used only to expose the human-readable Salesforce field Label in the browser suggestion UI.

Testing

  • Ran syntax validation:
    node --check addon/data-import.js
image

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