Rama Tito
asked on
Extract data from jsan format.
HI, In node red, I did create node to count number of rows in "mytab" table.
Result from node-red after count total number of row in mytab table is.
SELECT COUNT(count) FROM mytab : msg.payload : string[20]
"[{"COUNT(count)":8}]"
I am trying to extract number of rows, in this case it is --> 8.
Error msg after executing pop up saying : -
function : (error)
"ReferenceError: count is not defined (line 4, col 28)"
msg.topic = "SELECT COUNT(count) FROM mytab";
return msg;
Result from node-red after count total number of row in mytab table is.
SELECT COUNT(count) FROM mytab : msg.payload : string[20]
"[{"COUNT(count)":8}]"
I am trying to extract number of rows, in this case it is --> 8.
var obj = msg.payload;
var json = JSON.parse(obj);
var Device = json[0].COUNT(count);
msg.payload = Device;
return msg;
Error msg after executing pop up saying : -
function : (error)
"ReferenceError: count is not defined (line 4, col 28)"
ASKER
may i know why different. instead of j[0].Count(count) ? i couldn't get.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you
Open in new window