Reporting Module Table - Use column index instead of column name

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:

@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:

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. :face_with_monocle:

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:

and this:

1 Like

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. :face_in_clouds:

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.

1 Like

Thank you, Paul!

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

1 Like