You can now define exactly how your human-readable column headers map to JSON properties in config/pages.json.
Human-readable headers:
"columns": ["Team Name", "Efficiency Rating", "National Rank", "Conference"]Maps to JSON properties:
"columnMappings": {
"Team Name": "team",
"Efficiency Rating": "adjEm",
"National Rank": "rank",
"Conference": "conf"
}Your JSON can have any property names:
[
{
"team": "Scranton",
"adjEm": 54.2,
"rank": 2,
"conf": "LAND"
}
]Human-readable headers:
"columns": [
"Player Name",
"Points Per Game",
"Field Goal Percentage",
"Free Throw %",
"Conference"
]Maps to your JSON structure:
"columnMappings": {
"Player Name": "playerName",
"Points Per Game": "ppg",
"Field Goal Percentage": "fgPct",
"Free Throw %": "ftPct",
"Conference": "conf"
}Your JSON structure:
[
{
"playerName": "Sarah Johnson",
"ppg": 18.4,
"fgPct": 0.485,
"ftPct": 0.821,
"conf": "NEWMAC"
}
]Excel Column Headers (Human-readable):
Team Name | Points Scored | Win Percentage | Conference Name
JSON Properties (Code-friendly):
{
"tm": "Scranton",
"pts": 1847,
"winPct": 0.875,
"conference": "LAND"
}Mapping Configuration:
"columns": ["Team Name", "Points Scored", "Win Percentage", "Conference Name"],
"columnMappings": {
"Team Name": "tm",
"Points Scored": "pts",
"Win Percentage": "winPct",
"Conference Name": "conference"
}- Human-readable headers - Your users see "Points Per Game" not "ppg"
- Flexible JSON keys - Use whatever property names work for your data
- Excel compatibility - Use natural column names from Excel exports
- Maintainability - Clear mapping in one configuration file
- Fallback support - System still tries to auto-match if no mapping provided
- Add your human-readable column headers to
columnsarray - Add corresponding mappings to
columnMappingsobject - Run
npm run buildto regenerate pages - Replace JSON data file with your Excel export
The system will handle the rest automatically!