# Getting result data from the Database Query Browser

**URL:** <https://forum.inductiveautomation.com/t/getting-result-data-from-the-database-query-browser/102055>\
**Category:** Module Development\
**Created:** [February 7, 2025, 8:47pm UTC](https://forum.inductiveautomation.com/t/getting-result-data-from-the-database-query-browser/102055 "2025-02-07T20:47:01Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nathan\_Foster](https://avatars.discourse-cdn.com/v4/letter/n/ecd19e/32.png) [@Nathan\_Foster](https://forum.inductiveautomation.com/u/Nathan_Foster)\
**Post date:** [February 7, 2025, 8:47pm UTC](https://forum.inductiveautomation.com/t/getting-result-data-from-the-database-query-browser/102055/1 "2025-02-07T20:47:01Z")

</div>

I'm having trouble getting the result data from the Database Query Browser. There looks to be a setter but no getter.

I got access to the query browser with

```python
QueryBrowser queryBrowser = context.getQueryBrowserPanel();

```

I have a menu item with an action listener that gets the selected results table.

```python
    menuItem.addActionListener(new ActionListener() {
    @Override
    public void actionPerformed(ActionEvent e) {
        ResultTable resultTable = queryBrowser.getSelectedTab();
        logger.info("Tab Name: " + resultTable.getTabName());
        logger.info("Last Query: " + resultTable.getLastQuery());
        logger.info("Index: " + Integer.toString(resultTable.getIndex()));

    }
});

```

Is it possible to get the result data?

---

<div class="post-metadata">

**Author:** ![bmusson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bmusson/32/87530_2.png) [@bmusson](https://forum.inductiveautomation.com/u/bmusson)\
**Post date:** [February 7, 2025, 9:08pm UTC](https://forum.inductiveautomation.com/t/getting-result-data-from-the-database-query-browser/102055/2 "2025-02-07T21:08:06Z")

</div>

Looks like you can get the JideTable from [`resultTable.table`](https://files.inductiveautomation.com/sdk/javadoc/ignition81/8.1.44/com/inductiveautomation/ignition/designer/querybrowser/ResultTable.html#table), the data should be in there via `getValueAt(row, column)`.

---

<div class="post-metadata">

**Author:** ![Nathan\_Foster](https://avatars.discourse-cdn.com/v4/letter/n/ecd19e/32.png) [@Nathan\_Foster](https://forum.inductiveautomation.com/u/Nathan_Foster)\
**Post date:** [February 7, 2025, 9:15pm UTC](https://forum.inductiveautomation.com/t/getting-result-data-from-the-database-query-browser/102055/3 "2025-02-07T21:15:58Z")

</div>

It looks to be protected and I get an access error when I try to compile.

---

<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:** [February 7, 2025, 9:17pm UTC](https://forum.inductiveautomation.com/t/getting-result-data-from-the-database-query-browser/102055/4 "2025-02-07T21:17:45Z")

</div>

The designer is mostly unenforcing if you use reflection to access that.

---

<div class="post-metadata">

**Author:** ![bmusson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bmusson/32/87530_2.png) [@bmusson](https://forum.inductiveautomation.com/u/bmusson)\
**Post date:** [February 7, 2025, 9:20pm UTC](https://forum.inductiveautomation.com/t/getting-result-data-from-the-database-query-browser/102055/5 "2025-02-07T21:20:53Z")

</div>

> [@Nathan\_Foster](#):
>
> protected

 ![](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/0/30692b8f78a33eb2fd6627a3616a332399389f89.png)

---

<div class="post-metadata">

**Author:** ![Nathan\_Foster](https://avatars.discourse-cdn.com/v4/letter/n/ecd19e/32.png) [@Nathan\_Foster](https://forum.inductiveautomation.com/u/Nathan_Foster)\
**Post date:** [February 7, 2025, 9:26pm UTC](https://forum.inductiveautomation.com/t/getting-result-data-from-the-database-query-browser/102055/6 "2025-02-07T21:26:21Z")

</div>

Interesting. I'm still a bit new to Java. Do you mind pointing me to a good resource or providing a simple example on what you mean by reflection?

---

<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:** [February 7, 2025, 9:28pm UTC](https://forum.inductiveautomation.com/t/getting-result-data-from-the-database-query-browser/102055/7 "2025-02-07T21:28:19Z")

</div>

[Class.getDeclaredField(...)](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Class.html#getDeclaredField(java.lang.String))

Down the rabbit hole you go....

---

<div class="post-metadata">

**Author:** ![Nathan\_Foster](https://avatars.discourse-cdn.com/v4/letter/n/ecd19e/32.png) [@Nathan\_Foster](https://forum.inductiveautomation.com/u/Nathan_Foster)\
**Post date:** [February 7, 2025, 9:30pm UTC](https://forum.inductiveautomation.com/t/getting-result-data-from-the-database-query-browser/102055/8 "2025-02-07T21:30:36Z")

</div>

😂 I love rabbit holes. Thanks!

...

It worked!

---

<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:** [February 7, 2025, 9:47pm UTC](https://forum.inductiveautomation.com/t/getting-result-data-from-the-database-query-browser/102055/9 "2025-02-07T21:47:31Z")

</div>

My question is: What are you trying to do with the DB query browser from Java?

---

<div class="post-metadata">

**Author:** ![Nathan\_Foster](https://avatars.discourse-cdn.com/v4/letter/n/ecd19e/32.png) [@Nathan\_Foster](https://forum.inductiveautomation.com/u/Nathan_Foster)\
**Post date:** [February 7, 2025, 10:20pm UTC](https://forum.inductiveautomation.com/t/getting-result-data-from-the-database-query-browser/102055/10 "2025-02-07T22:20:00Z")

</div>

Some colleagues wanted a convenient export button feature (CSV, Spreadsheet). I know I could easily do that with a python API function or do something similar with a Perspective project, but there is no fun in that.

---

<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:** [February 9, 2025, 1:45am UTC](https://forum.inductiveautomation.com/t/getting-result-data-from-the-database-query-browser/102055/11 "2025-02-09T01:45:49Z")

</div>

If you select the results you care about in the query browser and Ctrl/Cmd + _Shift_ + C, the data will be copied to the clipboard as TSV, which pastes directly into Excel/etc as tabular data.

Not to discourage the learning exercise 🙂
