# Reporting. Access report table row index or nested query data in configureChart() script

**URL:** <https://forum.inductiveautomation.com/t/reporting-access-report-table-row-index-or-nested-query-data-in-configurechart-script/108032>\
**Category:** Ignition\
**Tags:** reporting\
**Created:** [July 2, 2025, 10:13am UTC](https://forum.inductiveautomation.com/t/reporting-access-report-table-row-index-or-nested-query-data-in-configurechart-script/108032 "2025-07-02T10:13:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![RodrigoR](https://avatars.discourse-cdn.com/v4/letter/r/d78d45/32.png) [@RodrigoR](https://forum.inductiveautomation.com/u/RodrigoR)\
**Post date:** [July 2, 2025, 10:13am UTC](https://forum.inductiveautomation.com/t/reporting-access-report-table-row-index-or-nested-query-data-in-configurechart-script/108032/1 "2025-07-02T10:13:24Z")

</div>

Hi all,

I’m working on an Ignition report where I have a main query that returns a list of stations. For each station, I have a nested query that retrieves related event data specific to that station.

 ![imagen](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/7/575c47e66e6ab77de1c57d4b87b8154e96960cd8.png)

In my report, I display a table with one row per station, and inside each row, I embed a chart that should show the station’s event data. I’m using the `configureChart(chart, data)` scripting function to customize the chart to display a timeline, but the `data` parameter contains the full dataset, and I have no direct access to the nested query results related to that specific station or to the current row index of the report table.

How can I access the nested query results for each station inside the `configureChart` script for the chart embedded in that station’s row?

---

<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:** [July 2, 2025, 4:48pm UTC](https://forum.inductiveautomation.com/t/reporting-access-report-table-row-index-or-nested-query-data-in-configurechart-script/108032/2 "2025-07-02T16:48:03Z")

</div>

Hmm. Unfortunately, the `data` you have access to in `configureChart` is already flattened so you don't have access to the nested data structures.

The first workaround that comes to my mind is a scripted datasource that iterates through the nested query results (where you _can_ access them) and generates 'top level' data keys that are indexed appropriately. I'm not sure the best way to access that index from `configureChart`, but it might be an option...

---

<div class="post-metadata">

**Author:** ![RodrigoR](https://avatars.discourse-cdn.com/v4/letter/r/d78d45/32.png) [@RodrigoR](https://forum.inductiveautomation.com/u/RodrigoR)\
**Post date:** [July 3, 2025, 6:38am UTC](https://forum.inductiveautomation.com/t/reporting-access-report-table-row-index-or-nested-query-data-in-configurechart-script/108032/3 "2025-07-03T06:38:57Z")

</div>

I ended up solving this by using the row number from the table as the X-axis label. In the `configureChart` function, I retrieved the row index to look up the `stationId` from the top-level query results. Then I used that `stationId` to filter the events dataset.

```python
plot = chart.getPlot()
domain_axis = plot.getDomainAxis()
if domain_axis is not None:
	row = domain_axis.getLabel()
target_station_id = data['stations'].getValueAt(int(row)-1,0)
sap_timeline = data['sap_timeline']
filtered_sap_timeline = sap_timeline[str(target_station_id)]

```

---

<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:** [July 3, 2025, 12:41pm UTC](https://forum.inductiveautomation.com/t/reporting-access-report-table-row-index-or-nested-query-data-in-configurechart-script/108032/4 "2025-07-03T12:41:14Z")

</div>

Split this topic on July 3, 2025, 12:41pm UTC

A post was split to a new topic: [Continuously Varying Data in Report Viewer](https://forum.inductiveautomation.com/t/continuously-varying-data-in-report-viewer/108099)
