# Reporting script data source - can we reference the results of a previous query data source?

**URL:** <https://forum.inductiveautomation.com/t/reporting-script-data-source-can-we-reference-the-results-of-a-previous-query-data-source/117109>\
**Category:** Ignition\
**Tags:** ignition83, reporting\
**Created:** [September 16, 2026, 10:09pm UTC](https://forum.inductiveautomation.com/t/reporting-script-data-source-can-we-reference-the-results-of-a-previous-query-data-source/117109 "2026-09-16T22:09:53Z")\
**Posts on this page:** 2\
**Page:** 1

<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:** [September 16, 2026, 10:09pm UTC](https://forum.inductiveautomation.com/t/reporting-script-data-source-can-we-reference-the-results-of-a-previous-query-data-source/117109/1 "2026-09-16T22:09:53Z")

</div>

A report query data source returns a single row,

```python
v-- ITEMS
 +- Description
 +- LotId
 +- Material

```

I want a script data source to calculate a value based on values from the ITEMS data source.  
How do I address the individual columns in the query data source? e.g., a variation of the `data['ITEMS']` syntax?

---

<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:** [September 16, 2026, 10:14pm UTC](https://forum.inductiveautomation.com/t/reporting-script-data-source-can-we-reference-the-results-of-a-previous-query-data-source/117109/2 "2026-09-16T22:14:03Z")

</div>

The returned value of a query will be a `QueryResults` object:

> **[QueryResults](https://sdk.inductiveautomation.com/javadoc/ignition83/latest/com/inductiveautomation/reporting/common/api/QueryResults.html)**
>
> declaration: package: com.inductiveautomation.reporting.common.api, class: QueryResults

So probably you want [`coreResults`](https://sdk.inductiveautomation.com/javadoc/ignition83/latest/com/inductiveautomation/reporting/common/api/QueryResults.html#getCoreResults()) to get the underlying dataset.
