# Scripting Returning Object, Array Needed for Time Series Chart

**URL:** <https://forum.inductiveautomation.com/t/scripting-returning-object-array-needed-for-time-series-chart/78467>\
**Category:** General Discussion\
**Tags:** perspective, scripting\
**Created:** [August 28, 2023, 5:40pm UTC](https://forum.inductiveautomation.com/t/scripting-returning-object-array-needed-for-time-series-chart/78467 "2023-08-28T17:40:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pico\_Sankari](https://avatars.discourse-cdn.com/v4/letter/p/aeb1de/32.png) [@Pico\_Sankari](https://forum.inductiveautomation.com/u/Pico_Sankari)\
**Post date:** [August 28, 2023, 5:40pm UTC](https://forum.inductiveautomation.com/t/scripting-returning-object-array-needed-for-time-series-chart/78467/1 "2023-08-28T17:40:21Z")

</div>

I'm trying to query some data and then put it in a timeseries chart. The query returns an object, but the timeseries wants an array. Is there a way to convert this object into an array so that I can use the chart?

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [August 28, 2023, 5:51pm UTC](https://forum.inductiveautomation.com/t/scripting-returning-object-array-needed-for-time-series-chart/78467/2 "2023-08-28T17:51:29Z")

</div>

Add a script transform and process your query's return there.

But there's something weird here: the default format for query is a dataset. Which a timeseries chart should be able to handle.

We'll need details about what you're trying to do.

---

<div class="post-metadata">

**Author:** ![Pico\_Sankari](https://avatars.discourse-cdn.com/v4/letter/p/aeb1de/32.png) [@Pico\_Sankari](https://forum.inductiveautomation.com/u/Pico_Sankari)\
**Post date:** [August 28, 2023, 6:13pm UTC](https://forum.inductiveautomation.com/t/scripting-returning-object-array-needed-for-time-series-chart/78467/3 "2023-08-28T18:13:51Z")

</div>

I have a transaction group that puts data into a table when certain events occur. I would like to query some of that data (certain columns over certain time ranges) and then chart it. I got around the object array problem by sending the data to the right place (self.props.series[0].data instead of self.props.series), but now have a different issue: the time series chart just says component error and I can't get further information on the error. Not sure where to go here.

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [August 29, 2023, 12:20pm UTC](https://forum.inductiveautomation.com/t/scripting-returning-object-array-needed-for-time-series-chart/78467/4 "2023-08-29T12:20:01Z")

</div>

I've only used the time series chart once so I wouldn't be of much help, but I doubt anyone can help you solve your issue based on that - we'll need more details.
