# Table Named Query

**URL:** <https://forum.inductiveautomation.com/t/table-named-query/24562>\
**Category:** Ignition Early Access\
**Created:** [May 1, 2019, 5:10pm UTC](https://forum.inductiveautomation.com/t/table-named-query/24562 "2019-05-01T17:10:33Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![craigb](https://avatars.discourse-cdn.com/v4/letter/c/9f8e36/32.png) [@craigb](https://forum.inductiveautomation.com/u/craigb)\
**Post date:** [May 1, 2019, 5:10pm UTC](https://forum.inductiveautomation.com/t/table-named-query/24562/1 "2019-05-01T17:10:33Z")

</div>

I have a table, linked to a named query. Named query caching is off, table polling is set to 5 seconds.

When I add / edit the table on a client. The other clients do not update unless you navigate to another page and back again. I’m guessing its because every time you open the page it calls the query to update.

If we have monitors / TV’s displaying data, their page will never change. How will we get table to update? Will i need some timer code somewhere to force the table to update ?

---

<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:** [May 1, 2019, 8:34pm UTC](https://forum.inductiveautomation.com/t/table-named-query/24562/2 "2019-05-01T20:34:23Z")

</div>

Consider using sendMessage() in the client that performs the update (after the results come back) to notify interested clients to use system.db.refresh() on the affected bindings.

---

<div class="post-metadata">

**Author:** ![osolorzano](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/osolorzano/32/6432_2.png) [@osolorzano](https://forum.inductiveautomation.com/u/osolorzano)\
**Post date:** [May 1, 2019, 9:54pm UTC](https://forum.inductiveautomation.com/t/table-named-query/24562/3 "2019-05-01T21:54:57Z")

</div>

I was not able to replicate the issue you are seeing, with polling enabled the table should update every 5 seconds with any changes to the data the query would pick up. Are you using Vision or Perspective here? and how is your polling configured?

---

<div class="post-metadata">

**Author:** ![craigb](https://avatars.discourse-cdn.com/v4/letter/c/9f8e36/32.png) [@craigb](https://forum.inductiveautomation.com/u/craigb)\
**Post date:** [May 1, 2019, 10:11pm UTC](https://forum.inductiveautomation.com/t/table-named-query/24562/4 "2019-05-01T22:11:15Z")

</div>

Sorry I should have said Im using perspective, Nightly build from yesterday in windows environment but neither the chrome browser, android or IOS apps update either.

Polling is set to 5 seconds on the screen for binding the data, Everything is turned off except polling and enabled. Return is set to auto and its returning a data set.

If i edit or add more lines in the database (directly into the database) the table does not update unless I navigate away and back to the table.

---

<div class="post-metadata">

**Author:** ![osolorzano](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/osolorzano/32/6432_2.png) [@osolorzano](https://forum.inductiveautomation.com/u/osolorzano)\
**Post date:** [May 1, 2019, 11:54pm UTC](https://forum.inductiveautomation.com/t/table-named-query/24562/5 "2019-05-01T23:54:55Z")

</div>

I am still not able to replicate it. I moved to the latest nightly and tried a few settings but it always updates appropriately. Would you mind right-clicking the table and hitting Copy, then pasting it into notepad and sending that over to me?

---

<div class="post-metadata">

**Author:** ![craigb](https://avatars.discourse-cdn.com/v4/letter/c/9f8e36/32.png) [@craigb](https://forum.inductiveautomation.com/u/craigb)\
**Post date:** [May 2, 2019, 1:18am UTC](https://forum.inductiveautomation.com/t/table-named-query/24562/6 "2019-05-02T01:18:21Z")

</div>

```auto
[
  {
    "type": "ia.container.coord",
    "version": 0,
    "props": {
      "mode": "percent",
      "style": {
        "backgroundColor": "#FFFFFF",
        "border-left": "15px solid #AAA",
        "borderRadius": "10px",
        "borderStyle": "solid",
        "borderWidth": "2px"
      }
    },
    "meta": {
      "name": "Table Container"
    },
    "position": {
      "breakpoints": [
        {
          "colIndex": 0,
          "name": "sm",
          "order": 0.5,
          "rowIndex": 1,
          "span": 12
        },
        {
          "colIndex": 5,
          "name": "md",
          "order": 3,
          "rowIndex": 0,
          "span": 7
        },
        {
          "colIndex": 4,
          "name": "lg",
          "order": 3,
          "rowIndex": 0,
          "span": 8
        }
      ],
      "height": 410
    },
    "custom": {},
    "children": [
      {
        "type": "ia.display.table",
        "version": 0,
        "props": {
          "virtualized": false,
          "selection": {
            "selectedColumn": "Manufacturer",
            "selectedRow": 0
          },
          "rows": {
            "style": {
              "borderStyle": "solid",
              "borderWidth": "1px",
              "color": "#555555",
              "textAlign": "center"
            }
          },
          "cells": {
            "style": {
              "textAlign": "center"
            }
          },
          "pager": {
            "bottom": false
          },
          "style": {
            "fontSize": "12px",
            "textAlign": "center"
          }
        },
        "meta": {
          "name": "Table"
        },
        "position": {
          "height": 0.9125,
          "width": 0.9443,
          "x": 0.0289,
          "y": 0.0465
        },
        "custom": {},
        "propConfig": {
          "props.data": {
            "binding": {
              "config": {
                "designerUseLimit": false,
                "polling": {
                  "enabled": true,
                  "rate": "5"
                },
                "queryPath": "Assets/Select Assets"
              },
              "type": "query"
            }
          }
        }
      }
    ],
    "propConfig": {
      "props.style.borderColor": {
        "binding": {
          "config": {
            "mode": "direct",
            "tagPath": "[default]Colours/Orange"
          },
          "type": "tag"
        }
      }
    }
  }
]

```

---

<div class="post-metadata">

**Author:** ![craigb](https://avatars.discourse-cdn.com/v4/letter/c/9f8e36/32.png) [@craigb](https://forum.inductiveautomation.com/u/craigb)\
**Post date:** [May 2, 2019, 5:34am UTC](https://forum.inductiveautomation.com/t/table-named-query/24562/7 "2019-05-02T05:34:30Z")

</div>

I’ve done some more testing.

It seems like after I apply the binding to the table and OK it, it will poll correctly after i add a new line to the table, but when I add another line to the table it wont poll again.

Almost as if the polling time isn’t restarting, It also seems like if I dont add a new line with in the initial polled time it wont poll at all, until I reapply the binding to the table.

---

<div class="post-metadata">

**Author:** ![osolorzano](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/osolorzano/32/6432_2.png) [@osolorzano](https://forum.inductiveautomation.com/u/osolorzano)\
**Post date:** [May 2, 2019, 5:15pm UTC](https://forum.inductiveautomation.com/t/table-named-query/24562/8 "2019-05-02T17:15:18Z")

</div>

Well nothing appears to be wrong with your table or the container it is in. The polling appears to be working for me. Are you by chance getting any errors in the designer or gateway that could be affecting the query?

---

<div class="post-metadata">

**Author:** ![craigb](https://avatars.discourse-cdn.com/v4/letter/c/9f8e36/32.png) [@craigb](https://forum.inductiveautomation.com/u/craigb)\
**Post date:** [May 2, 2019, 11:49pm UTC](https://forum.inductiveautomation.com/t/table-named-query/24562/9 "2019-05-02T23:49:03Z")

</div>

I’ve looked and no errors.

I did a fresh install on the server with todays nightly, uploaded the project and same problem.

It will poll once and not again. I opened client in 2 different machines, the server and a tablet and none will update. I’ve tried every setting but just cant get it to keep polling. Until I navigate away and back.

The data is entered via a pop up, then saved with a button which does a ‘system.db.runPrepUpdate’  
The data is going direct into the table as I can see it in the database instantly but the tables in the client just wont pick it up.

---

<div class="post-metadata">

**Author:** ![Paul.Scott](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul.scott/32/4578_2.png) [@Paul.Scott](https://forum.inductiveautomation.com/u/Paul.Scott)\
**Post date:** [May 3, 2019, 12:00am UTC](https://forum.inductiveautomation.com/t/table-named-query/24562/10 "2019-05-03T00:00:25Z")

</div>

Somewhat random suggestion, but if you enable the `Bypass Cache` setting on the binding, do you see the newer results when the binding polls?

---

<div class="post-metadata">

**Author:** ![craigb](https://avatars.discourse-cdn.com/v4/letter/c/9f8e36/32.png) [@craigb](https://forum.inductiveautomation.com/u/craigb)\
**Post date:** [May 3, 2019, 12:18am UTC](https://forum.inductiveautomation.com/t/table-named-query/24562/11 "2019-05-03T00:18:28Z")

</div>

No difference. I have my query DB browser open set to auto refresh, I can see the db table entry appear but table wont poll. I have polling set to 10 seconds. If I don’t add a entry with in 10 seconds it wont poll at all, If I add a entry before 10 seconds it will poll once and not again.

If you want I can create a log in, send it Via PM and you can take a look, Its not a live production server, just testing.

---

<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:** [May 3, 2019, 12:25am UTC](https://forum.inductiveautomation.com/t/table-named-query/24562/12 "2019-05-03T00:25:54Z")

</div>

At this point, getting in contact with support would probably be best - there’s a lot of variables, so having full access including to your designer/DB to verify things would be best.

---

<div class="post-metadata">

**Author:** ![craigb](https://avatars.discourse-cdn.com/v4/letter/c/9f8e36/32.png) [@craigb](https://forum.inductiveautomation.com/u/craigb)\
**Post date:** [May 3, 2019, 5:29am UTC](https://forum.inductiveautomation.com/t/table-named-query/24562/13 "2019-05-03T05:29:47Z")

</div>

I’ve entered a support ticket but I’ve also found a way around for the time being.

I created a query tag, put the query in there to create a dataset on a fixed rate then use that for the data prop in the table.  
The table now polls correctly (if you can call that way correct)

---

<div class="post-metadata">

**Author:** ![guganathan.r](https://avatars.discourse-cdn.com/v4/letter/g/8dc957/32.png) [@guganathan.r](https://forum.inductiveautomation.com/u/guganathan.r)\
**Post date:** [December 10, 2019, 7:32am UTC](https://forum.inductiveautomation.com/t/table-named-query/24562/14 "2019-12-10T07:32:36Z")

</div>

I’m facing the same issue. I created a perspective table with named query to fetch the data, if I activate polling then all my configured events and button actions in this session are delayed between 30 to 60 secs right from session startup.  
If I deactivate polling, all the events and button actions working normal, but the table doesn’t get updated with real time update.  
I tries suggested solution of creating a query tag with fixed rate, yet the problem is same, all my configured events and button actions in this session are delayed between 30 to 60 secs right from session startup.  
And this delay happens only on tablet perspective users. Not for computer users.  
@craigb Was there any solution identified for this from the support ticket?

---

<div class="post-metadata">

**Author:** ![craigb](https://avatars.discourse-cdn.com/v4/letter/c/9f8e36/32.png) [@craigb](https://forum.inductiveautomation.com/u/craigb)\
**Post date:** [December 10, 2019, 4:37pm UTC](https://forum.inductiveautomation.com/t/table-named-query/24562/15 "2019-12-10T16:37:16Z")

</div>

If i remember correctly when i updated my version that seem to fixed the issue. I also changed the way I done things and cut down on polling dramatically.

If your table is only updating when you are adding or editing fields then you can turn off polling and use something like the following on your button…

```auto
self.parent.parent.getChild("Table Container").getChild("Table").refreshBinding("props.data")

```

This will refresh the table every time you press the button which could be a edit or add button etc. Anytime the view is opened with a named query it updates regardless of polling.

For the fixed rate query tag, attached is how i had it set up and working for 1 second polling.

 ![Capture](https://us1.discourse-cdn.com/inductiveautomation/original/2X/3/33ad8900d60c3517a76afd5ad6f742ab4d52b2e7.png)

---

<div class="post-metadata">

**Author:** ![guganathan.r](https://avatars.discourse-cdn.com/v4/letter/g/8dc957/32.png) [@guganathan.r](https://forum.inductiveautomation.com/u/guganathan.r)\
**Post date:** [December 11, 2019, 1:47am UTC](https://forum.inductiveautomation.com/t/table-named-query/24562/16 "2019-12-11T01:47:05Z")

</div>

> [@craigb](#):
>
> This will refresh the table every time you press the button which could be a edit or add button etc. Anytime the view is opened with a named query it updates regardless of polling.
> 
> For the fixed rate query tag, attached is how i had it set up and

Thanks for the prompt reply. Actually I'm running on 8.0.6 STABLE, still the problem persists.  
Yes I did create a query tag with fixed rate exactly as the picture you attached, but the delay continues to exist.

At present I do the same as you suggested with refresh on button press, but the table will be updated by other clients as well, hence we need to keep the table updated real time. I badly need this option to work.

---

<div class="post-metadata">

**Author:** ![craigb](https://avatars.discourse-cdn.com/v4/letter/c/9f8e36/32.png) [@craigb](https://forum.inductiveautomation.com/u/craigb)\
**Post date:** [December 11, 2019, 3:18am UTC](https://forum.inductiveautomation.com/t/table-named-query/24562/17 "2019-12-11T03:18:36Z")

</div>

I’ll do some digging around tomorrow and see if can replicate the error I had.

Do you have the cache options enabled?

---

<div class="post-metadata">

**Author:** ![guganathan.r](https://avatars.discourse-cdn.com/v4/letter/g/8dc957/32.png) [@guganathan.r](https://forum.inductiveautomation.com/u/guganathan.r)\
**Post date:** [December 11, 2019, 4:36am UTC](https://forum.inductiveautomation.com/t/table-named-query/24562/18 "2019-12-11T04:36:03Z")

</div>

I hope you mean “bypass cache”.  
I did try both, with and without bypass cache. Still same issue.
