# Reporting Module Table - Use column index instead of column name

**URL:** <https://forum.inductiveautomation.com/t/reporting-module-table-use-column-index-instead-of-column-name/89140>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [April 19, 2024, 7:58pm UTC](https://forum.inductiveautomation.com/t/reporting-module-table-use-column-index-instead-of-column-name/89140 "2024-04-19T19:58:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![carlosbqz](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carlosbqz/32/52324_2.png) [@carlosbqz](https://forum.inductiveautomation.com/u/carlosbqz)\
**Post date:** [April 19, 2024, 7:58pm UTC](https://forum.inductiveautomation.com/t/reporting-module-table-use-column-index-instead-of-column-name/89140/1 "2024-04-19T19:58:14Z")

</div>

Hello, good evening everyone,

As the title suggests, I'm trying to use column indexes instead of column names to populate a _Table component_ in the Reporting Module of Ignition.

The reason I'm attempting this approach is because the names of the columns in my data source change approximately every two months, but the number of columns remains consistent.

Here's what I've tried so far:

```python
@Productos_Prueba[0].value@
@Productos_Prueba[0]@

```

Unfortunately, this hasn't worked as I expected hehe. Instead of returning the values, it returns an object reference:

```python
com.inductiveautomation.reporting.common.api.QueryResults$Row@5ce3b718
com.inductiveautomation.reporting.common.api.QueryResults$Row@59913f92

```

Has anyone tried this before or have any suggestions on how to extract the actual values using column indexes? I would appreciate any guidance or examples you might share.

Thanks in advance!

I’m happy to provide more details about my project if needed. 🧐

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [April 19, 2024, 8:47pm UTC](https://forum.inductiveautomation.com/t/reporting-module-table-use-column-index-instead-of-column-name/89140/2 "2024-04-19T20:47:05Z")

</div>

The table in the report will need consistent names. Use a script data source to present the unchanging names it will need. To work with script data sources, you probably want to review this:

> [@Report with Scripted Nested Data](https://forum.inductiveautomation.com/t/report-with-scripted-nested-data/11801):
>
> The report datasource scripting examples explain how to access the nested data in another key for use constructing a custom dataset. What I don’t see is how to construct nested data that would be suitable for use with a child table in a table group. I have a parent dataset that I’m constructing via script due to annoying limitations of an ancient SQL Server 2000 instance. I need a subquery for each row that could be done with a normal query, but there’s no way to add a regular subquery to a s…

and this:

> **[Scripting Data Source | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.1/ignition-modules/reporting/report-data/scripting-data-source#script-data-source)**
>
> Script Data Source

---

<div class="post-metadata">

**Author:** ![carlosbqz](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carlosbqz/32/52324_2.png) [@carlosbqz](https://forum.inductiveautomation.com/u/carlosbqz)\
**Post date:** [April 19, 2024, 8:59pm UTC](https://forum.inductiveautomation.com/t/reporting-module-table-use-column-index-instead-of-column-name/89140/3 "2024-04-19T20:59:23Z")

</div>

Thank you very much Phil!

Using scripting was my Plan B, as I was hoping to use indexes directly. It looks like I'll have to go with that approach. 😶‍🌫️

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [April 19, 2024, 9:15pm UTC](https://forum.inductiveautomation.com/t/reporting-module-table-use-column-index-instead-of-column-name/89140/4 "2024-04-19T21:15:46Z")

</div>

Note also, to save you some headache down the road, that you can't name columns with leading numerals. So if you end up making column "names" that correspond to column indices, make sure you prefix with an underscore or something to save yourself some grief.

---

<div class="post-metadata">

**Author:** ![carlosbqz](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carlosbqz/32/52324_2.png) [@carlosbqz](https://forum.inductiveautomation.com/u/carlosbqz)\
**Post date:** [April 19, 2024, 10:26pm UTC](https://forum.inductiveautomation.com/t/reporting-module-table-use-column-index-instead-of-column-name/89140/5 "2024-04-19T22:26:47Z")

</div>

Thank you, Paul!

That was actually the first thing that crossed my mind 😅. I appreciate the heads-up.
