# Reporting - Accessing values from Script Source in an SQL Source

**URL:** <https://forum.inductiveautomation.com/t/reporting-accessing-values-from-script-source-in-an-sql-source/44067>\
**Category:** Ignition\
**Tags:** ignition80\
**Created:** [March 3, 2021, 9:01pm UTC](https://forum.inductiveautomation.com/t/reporting-accessing-values-from-script-source-in-an-sql-source/44067 "2021-03-03T21:01:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![grietveld](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/grietveld/32/6984_2.png) [@grietveld](https://forum.inductiveautomation.com/u/grietveld)\
**Post date:** [March 3, 2021, 9:01pm UTC](https://forum.inductiveautomation.com/t/reporting-accessing-values-from-script-source-in-an-sql-source/44067/1 "2021-03-03T21:01:05Z")

</div>

Can access datapoints from a script source as a parameter for SQL queries?

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/2/02abbdbc2ce3cf04a8e326ac778565613217af35.png)

The values are being passed, since I am using them elsewhere in the report, but my query data sorces don’t seem to return any data even though these are populated. I’m not sure if I’m just accessing them wrong? or if I’ll just have to move the queries into the script as well.

Thanks!

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/e/be29831f31fe2a4348b9ffede49350b3dabfd317.png)

---

<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:** [March 4, 2021, 12:44pm UTC](https://forum.inductiveautomation.com/t/reporting-accessing-values-from-script-source-in-an-sql-source/44067/2 "2021-03-04T12:44:13Z")

</div>

Remove the `data[]` from the parameters. Use just `valveSN` in the example above. Note that the order of data keys matters–queries that use keys from your script must be _below_ the script in the list.

---

<div class="post-metadata">

**Author:** ![grietveld](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/grietveld/32/6984_2.png) [@grietveld](https://forum.inductiveautomation.com/u/grietveld)\
**Post date:** [March 4, 2021, 1:14pm UTC](https://forum.inductiveautomation.com/t/reporting-accessing-values-from-script-source-in-an-sql-source/44067/3 "2021-03-04T13:14:03Z")

</div>

Thanks for saving me yet again haha. I thought I tried that, but maybe I had something else wrong when I attempted that the first time.
