global.set("dad_welcome","played");
context.global.dad_welcome = msg.payload;
return msg;global.set("dad_welcome","not_played");
context.global.dad_welcome = msg.payload;
return msg;Any help would be appreciated.
Thanks
--
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.
For more options, visit https://groups.google.com/d/optout.
This is the intent. I need the variable to change based on if i have played the welcome or not already.
You received this message because you are subscribed to a topic in the Google Groups "Node-RED" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/node-red/Wa65rMHI840/unsubscribe.
To unsubscribe from this group and all its topics, send an email to node-red+u...@googlegroups.com.
Oh wait, i think I see what you saying...i should remove the global.dad_welcome = msg.payload otherwise i am resetting it instead of setting it.....
You received this message because you are subscribed to a topic in the Google Groups "Node-RED" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/node-red/Wa65rMHI840/unsubscribe.
To unsubscribe from this group and all its topics, send an email to node-red+u...@googlegroups.com.
global.set("dad_welcome","played");
msg.payload = context.global.dad_welcome;
return msg;To unsubscribe from this group and stop receiving emails from it, send an email to node-red+unsubscribe@googlegroups.com.
To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.
For more options, visit https://groups.google.com/d/optout.
--
http://nodered.org
Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to a topic in the Google Groups "Node-RED" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/node-red/Wa65rMHI840/unsubscribe.
To unsubscribe from this group and all its topics, send an email to node-red+unsubscribe@googlegroups.com.
Thanks for this, I was not aware of one can use flow or global in the Switch node. Have always put things in the msg object before the Switch. Quite convenient to have these choices!