Hello, I'm using the node-red-contrib-mssql-plus
Everthing works well!
One thing is strange and Im struggeling ;(
The Returnvalue of the command Select Count returns the right Value but I can't use the returnvalue. The debugmessage shows the following:
9.12.2021, 14:48:52node: 8c733af0095bc140
site1 : msg.payload : array[1]
array[1]
0: object
499999
I cant view this Value 499999 in the dashboard. There allways appear: [{"":499999}]
If have try'd this also with the same Result!
If I use your suggestion in the debug window it shows:
9.12.2021, 15:36:37node: 8c733af0095bc140
site1 : msg.msg.payload[0] : Object
object
499999
Actually, that tells us the answer. The element is an object with an empty key name (or unprintable character). In a function node you can use something like
The results of a query to MSSQL is array of objects where the property names are the field names.
Try changing your query to something like select count(*) as RowCount from myTable
Also, instead of selecting text in the debug panel, please use the copy value button that appears under your mouse cursor when you hover over the payload in the debug window. And please use the code button when pasting code/data into the forum.
Canned replies...
Canned reply 1...
in order to make code more readable and importable it is important to surround your code with three backticks ``` like this ```
There’s a great page in the docs that will explain how to use the debug panel to find the right path to any data item.
Pay particular attention to the part about the buttons that appear under your mouse pointer when you over hover a debug message property in the sidebar.
Thanks, the hint with
''' as RowCount''' was very helpfull, now the object Name is defined and i can read out the value of RowCount
Thank you verry much!!!