"instance[count]" is a literal string. The fact you have a variable called count doesn't have any bearing on that string.
You need to build the string:
var count = 3;
var test = global.get("instance["+count+"]");
msg.payload = test;
return msg;
Or, do it in two steps - get the compete array and then extract the individual element:
var count = 3;
var data = global.get("instance");
msg.payload = data[count];
return msg;
Nick
--
http://nodered.org
Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+u...@googlegroups.com.
To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.
To view this discussion on the web, visit https://groups.google.com/d/msgid/node-red/bdc63b1f-6e37-42f4-b621-eae64c180e71%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.