And in the case you get the same thing in the Testing tab, what do you get if you run this query directly on your database? Just so we know the expected result.
Yea I just tested it, doing a return None or erasing it does lead to a null result, not a class.org.python.core.PyNone.
Agreed, it looks like it should be scalar, in which case I’m unsure what you would need a transform script for. But it does appear to be one configured no?
@Resistor can you show the code from inside your transform script?
So to summarize - we expect to see 18, when you just bind to the namedQuery directly you get a null, and when you add transform script this turns into a PyNone? Very odd indeed. I’m out of ideas then.
Note you can always call Ignition Support, they’re very helpful, can remote in and help you troubleshoot directly.
Basically… and when I added the transform I used the type() function to see what type of data it was exactly.
Thanks anyway. I didn’t want to call because I barely know how to use the software and thought they only help troubleshooting but you needed to know how everything works
Oh well if you’re returning type() in your transform then it I can see why you get the PyNone at least.
You will get the most out of this forum generally speaking if you can show your code as well - that’s the only way any of us can really help you troubleshoot.
However the larger issue of your named query returning 18 in your testing tab but null in your binding is odd. The last thing I would ask - can you show your Authoring tab? I want to confirm the query in your Authoring tab matches what is shown in the binding.
Maybe what is causing this is that your named query was edited but not saved, so the testing shows one result, but the binding is still using the old version. Is the name named query you’re looking at in italics in the in the designer? Like this
Ok so its been edited. Save your project and reload you view. See if this fixes your issue.
Edit: I was able to recreate your basic problem. I created a named query that was SELECT 2 and bound that to a label text. Then I edited the query without saving it (which leaves it in italics) to SELECT 3
But my label still is running the result of the old named query until I save it -
After saving:
So save your project and then recheck your binding please.
Right, after you make edits to your named query for it to propagate your bindings you do have to save so that your NamedQuery does NOT appear in italics in the designer object tree. Glad that fixed it.
You might want to make a post for your separate time stamp problem however as to keep issues self contained to single threads to help people in the future who might search for the same problem.