# Adding friendly name to a table in perspective

**URL:** <https://forum.inductiveautomation.com/t/adding-friendly-name-to-a-table-in-perspective/111842>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [October 30, 2025, 9:29pm UTC](https://forum.inductiveautomation.com/t/adding-friendly-name-to-a-table-in-perspective/111842 "2025-10-30T21:29:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![patrick.glose](https://avatars.discourse-cdn.com/v4/letter/p/71e660/32.png) [@patrick.glose](https://forum.inductiveautomation.com/u/patrick.glose)\
**Post date:** [October 30, 2025, 9:29pm UTC](https://forum.inductiveautomation.com/t/adding-friendly-name-to-a-table-in-perspective/111842/1 "2025-10-30T21:29:31Z")

</div>

I have a table in Perspective but I wanted to change the names to something friendly. I used Transform in the binding to add a script. The script works, but the property editor is telling me I have 12 invalid key’s;

```python
def transform(self, value, quality, timestamp):

# If value is None, return empty list
    if not value:
        return []

    # Convert dataset to list of dictionaries
    py_data = []
    for i in range(value.rowCount):
        row_dict = {}
        for col in value.columnNames:
            row_dict[col] = value.getValueAt(i, col)
        py_data.append(row_dict)

    # Map to friendly column headers
    friendly_data = []
    for row in py_data:
        friendly_data.append({
        	"ID": row.get("id"),
            "Machine": row.get("machineId"),
            "Employee ID": row.get("employeeNumber"),
            "Work Center": row.get("workCenter"),
            "Job #": row.get("jobNumber"),
            "Bends": row.get("bendsPerPart"),
            "Pedal Pressed": row.get("pedalPressed"),
            "Total Hits": row.get("totalHits"),
            "Produced Hits": row.get("hitCounter")
        })

    return friendly_data

```

---

<div class="post-metadata">

**Author:** ![Samuel\_Sueur](https://avatars.discourse-cdn.com/v4/letter/s/e36b37/32.png) [@Samuel\_Sueur](https://forum.inductiveautomation.com/u/Samuel_Sueur)\
**Post date:** [October 30, 2025, 9:36pm UTC](https://forum.inductiveautomation.com/t/adding-friendly-name-to-a-table-in-perspective/111842/2 "2025-10-30T21:36:38Z")

</div>

There is usually no need to do this.

Use the columns property of the table to do that. See below:

> **[Perspective - Table | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.1/appendix/components/perspective-components/perspective-display-palette/perspective-table#properties)**
>
> The Table component displays database data in tabular form.

Once you point one column to a key in your data, you have access to the “header” property, where you can specify a more human-friendly text as the header of your column.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/3/93085e8d4a5e0d14e5888a22bd36e479c4fce6b8.png)

If you need more info about column configuration, see below:

> **[Table Column Configurations | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.1/appendix/components/perspective-components/perspective-display-palette/perspective-table/table-column-configurations)**
>
> This page contains examples that involve making changes to a table component's columns property.

You’ll have to define as many columns as you want data to be shown. In your script, you use 9 keys, that means you will have to define 9 columns.

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [October 30, 2025, 10:00pm UTC](https://forum.inductiveautomation.com/t/adding-friendly-name-to-a-table-in-perspective/111842/3 "2025-10-30T22:00:09Z")

</div>

> [@patrick.glose](#):
>
> the property editor is telling me I have 12 invalid key’s;

You have spaces in your keys. Perspective will tolerate them but they're not valid JSON.

A useful tool for checking is

> **[JSON Online Validator and Formatter - JSON Lint](https://jsonlint.com/)**
>
> JSONLint is the free online validator, json formatter, and json beautifier tool for JSON, a lightweight data-interchange format. You can format json, validate json, with a quick and easy copy+paste.

Copy the output of the binding and paste it into [https://jsonlint.com](https://jsonlint.com) and let it validate it.

---

<div class="post-metadata">

**Author:** ![patrick.glose](https://avatars.discourse-cdn.com/v4/letter/p/71e660/32.png) [@patrick.glose](https://forum.inductiveautomation.com/u/patrick.glose)\
**Post date:** [October 30, 2025, 10:07pm UTC](https://forum.inductiveautomation.com/t/adding-friendly-name-to-a-table-in-perspective/111842/4 "2025-10-30T22:07:26Z")

</div>

Okay, I see. I looked at the columns and it confused me, but now I get it. I add (9) columns, 0-8, and then I can edit the appearance of each. Thank you for clearing that up.
