A couple of years ago I developed my first custom node (node-red-contrib-msg-resend), which a couple of numeric inputs on the config screen:
Both numeric values can be set dynamically via the input message (msg.resend_interval and msg.resend_max_count). This means that the config screen input contains the default valuesAND these values can dynamically be overwritten via the input message.
Now I would like to allow the user to choose which msg field he wants to use (e.g. msg.payload.interval), instead of forcing him to use the msg.resend_xxxx fields.
This means I have to use typed inputs like this:
But then the interval is specified on the config screen OR in the input message.
So that would break existing flows...
Anybody has an idea how I can accomplish this?
Hi Michael,
Thanks for the assistance! Yes indeed, but in the early days I thought that the config screen contained the default values, which could be overwritten by a control message. But with the typedinput (containing an "msg" and a "num" option), which one of both you want ...
But at first sight your code snippet indeed should work. Will have to mention in my readme that the resend_xxx input message fields are read for legacy reasons ...