#1800·ce

Use column 'name' property instead of index in JSON conversion

Author: brajtkopf-annaCreated May 5, 2026Updated May 5, 2026

Currently, when converting rows to JSON (see src/utils/data.js#L387), the code assigns items to an object using the column index as the key, e.g., resultRow[index] = item. This results in objects with numeric keys, which are less readable and less practical for consumers of the exported JSON.

Improvement suggestion:

  • Use the name property of each column (from columns[index].name) as the key instead of the numeric index. This will produce objects with meaningful property names, making the exported JSON more self-descriptive and easier to work with.
  • Retain the numeric index as a fallback only if a column name is not specified.

Example of improved output:

javascript
{
  id: 123,
  name: 'Alice',
  email: '[email protected]'
}

Instead of:

javascript
{
  0: 123,
  1: 'Alice',
  2: '[email protected]'
}

This change will improve the usability and clarity of data exported in JSON format.