Named Query Help Vision

Hey there so I am currently having some troubles with named queries. I am using 7.9 and Vision.

The issue that I am running into is that I can create, bind, and see all the data from my named queries that pull data from our MES data base to show metrics but as soon as I try to open a client all the named queries are blank.

This only happens when Ignition is trying to pull from the MES database but I am not sure why? I have enabled all permissions on the client side (although I think named queries shouldn’t be ran client side?) but still no luck.

On one of the test applications I am messing around in I was able to circumvent this problem (don’t think this is best practice) by having the query be in a tag and then binding the data element of the table I want to the tag value.

There is no error message in the console from the queries failing to run and when I test them in the named query browser they work perfectly fine.

Any help would be greatly appreciated :smiley: thank you!

Wasn’t Perspective introduced with Version 8?

Are you passing parameters into your named queries? It’s going to be difficult to help without some code.


Sorry about that I meant vision, currently in the process of the upgrade but still on vision at the moment. And for I can post some code, not really sure what code would be helpful.

And yes I am passing the parameters into the named query in the binding property pop up that appears when I assign the binding. Also here is a snippet of one of the simple named queries that isn’t populating in the client view.

You have Query Type set to Query but the actual query looks like it should return a scalar value.
Should the Query Type be set to Scalar Query?
What is the binding expecting? A dataset, a document (JSON) or a scalar (a single value)?

1 Like

Hmm that particular one is expecting a scalar value for sure and I will definitely make that change but I also have a table that is expecting a dataset that is also not populating. I am going to change that to a scalar real quick and report back

So I just checked and changing it to scalar didn’t fix the issue, one thing I did notice is that the values flash once then disappear almost immediately.

It sounds like something else is overwriting the binding. Have you some scripts running on the gateway writing to the components?

No I don’t have anything setting these values except the binding, I also have disabled the security on the named query in case that was the issue but that didn’t fix it either.

Is the data showing up in the binding preview?
If so, then

  • Add a fresh Table component onto the view.
  • Run it and check that the Folsom default data is showing up.
  • Copy the original table’s qieru binding (using right-click, Copy Binding / Paste Binding) and see if the table renders properly. If it does then you may have some wonky column or CSS settngs on the original table.

It is showing up in the binding preview, and I just put a brand new table in there and still no luck

I did just notice that when I take a look in the db browser it says “Error Listing Columns”, but I am not sure why because I am able to query it in the designer view, I’m pretty stumped.

If there’s anything in the table’s datasource then post it here. (Use the </> button to format it. You can also use the :gear: Hide Details feature if you want to collapse the JSON.)

Sorry quick clarification, the component table’s data property, is that the table’s datasource?

Yes, I was going from (dodgy) memory.

OOOOO quick question if you know, how does ignition deal with spaces in the tables inside of the database, when I click on the table it gives me an error and says that the name is an invalid object but only lists the first part of the db name until the first space.

Welp doesn’t appear to be the issue either, same error when I click a db with no spaces in the name

Sorry, I don’t know. My earlier data source instruction was for Perspective. I forgot this is a 7.9 Vision project. Sorry.

1 Like

Also when I print the .data property from the client view it returns ‘Dataset [0R ? 4C]’

Zero rows, four columns. No data. Hmmm.