Skip to content

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

Description

@brajtkopf-anna

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:

{
  id: 123,
  name: 'Alice',
  email: 'alice@example.com'
}

Instead of:

{
  0: 123,
  1: 'Alice',
  2: 'alice@example.com'
}

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions