# sendRequest and return dataset

**URL:** <https://forum.inductiveautomation.com/t/sendrequest-and-return-dataset/16837>\
**Category:** Ignition\
**Tags:** ignition79, scripting\
**Created:** [February 1, 2018, 8:01am UTC](https://forum.inductiveautomation.com/t/sendrequest-and-return-dataset/16837 "2018-02-01T08:01:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kleppe85](https://avatars.discourse-cdn.com/v4/letter/k/c4cdca/32.png) [@Kleppe85](https://forum.inductiveautomation.com/u/Kleppe85)\
**Post date:** [February 1, 2018, 8:01am UTC](https://forum.inductiveautomation.com/t/sendrequest-and-return-dataset/16837/1 "2018-02-01T08:01:07Z")

</div>

Hi,

Is it possible to use the system.util.sendRequest to retrieve a dataset from another gateway?  
I can return a single value, but if I try to return a dataset I get a timeout. The dataset I’m testing with, only has 2x2 records, so I don’t think the timeout is because of a large number of data.

---

<div class="post-metadata">

**Author:** ![KathyApplebaum](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kathyapplebaum/32/7261_2.png) [@KathyApplebaum](https://forum.inductiveautomation.com/u/KathyApplebaum)\
**Post date:** [February 1, 2018, 2:49pm UTC](https://forum.inductiveautomation.com/t/sendrequest-and-return-dataset/16837/2 "2018-02-01T14:49:41Z")

</div>

You should be able to retrieve any Java Serializable object with sendRequest, so datasets shouldn’t be a problem. Double check your security zones if you have any set on the request handler, and turn the logger for “Scripting.Message” to trace.

---

<div class="post-metadata">

**Author:** ![Kleppe85](https://avatars.discourse-cdn.com/v4/letter/k/c4cdca/32.png) [@Kleppe85](https://forum.inductiveautomation.com/u/Kleppe85)\
**Post date:** [February 1, 2018, 8:26pm UTC](https://forum.inductiveautomation.com/t/sendrequest-and-return-dataset/16837/3 "2018-02-01T20:26:13Z")

</div>

I have created this messageHandler, no restrictions.  
Not using the payload messages for testing purposes 🙂 They are supposed to be in the query.

![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/1/1451ba864cff7a2075cade8aa072c67a01217a24.png)

Running it like this gives me the following log:

 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/0/006e52f41e14e4431a66903ef310c203088839b6.png)

If I change the return statement to “return queryDS[0][1]”, the correct value is returned…  
Is there something I’m missing?

---

<div class="post-metadata">

**Author:** ![KathyApplebaum](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kathyapplebaum/32/7261_2.png) [@KathyApplebaum](https://forum.inductiveautomation.com/u/KathyApplebaum)\
**Post date:** [February 5, 2018, 3:23pm UTC](https://forum.inductiveautomation.com/t/sendrequest-and-return-dataset/16837/4 "2018-02-05T15:23:13Z")

</div>

Everything looks like it should be good. You might email support and have them help figure out what’s going on with this.
