Inject node only fires if msg.payload is defined?

Inject node only fires if msg.payload defined?

So, msg.payload as any value, inject node fires when clicked. But if msg.* exists, but no msg.payload exits inject node does not fire. It is kind of a pain to add a change node to delete the payload, when you are just doing UI effects initialize, for example, enable/disable, color changes, etc., and the UI element is in pass-through mode, and should expect a payload other than initial message received for setup.

Another thought, would be nice if inject node could fire on context values as well, by the way. I often find I want to inject flow.* (something), but have to setup a change node to grab the flow variable because inject can't directly.

No, it works for me. What version of Node-RED?

Why not?

image

If your inject node doesnt look like this ↑ you are probably on a much older node-red version.

Ah... was this implemented in 1.2.9? But my initial question still stands... inject node firing without msg.payload existing.

No, Version 1.1 released 30 June 2020

Havent ran V1.1.x in over 9 months so cant say.

could be a bug with a specific version you have (you didnt say which version you are running)

Can you not upgrade?

Moving to 1.2.9... just have not gotten all the Pi devices to it. :slight_smile: Most of my Pi Zeros are 1.0.6.

1 Like

Don't feel so bad. I'm still running v0.18.4 on about 20 of the pi's in a industrial setting monitoring temps. They have one job and they do it well .... aint going to muck with it :stuck_out_tongue:

pi-version

1 Like

LOL! Yeah, I have about 10, and just for home automation and fun stuff... No real production... But what a PITA it is to update. I even automated the update so it is just a one click process. But I still seems to take forever to do it.

Yes, with the current version you can inject an empty message. It will just contain the msg id.

Cool... nice. Looks like time update everything to 1.2.9 now.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.