Custom Node Data Input Question

#1

I have created a custom node and in the .JS file there is a line of code which accepts the User Input Data from the HTML dialog.
This is the line of code I m referring:

this.applicationHash = config.applicationHash;

How can I override the user's data and accept data from an input that I pass in the msg object?

Thanks...

0 Likes

#2

well.... our basic rules is actually the opposite of that...
If the user has set a parameter then they actually want that value and so it should not be overridden. If they leave it blank then it should be set by a msg property...

usually in the on input handler you set a new variable

 var appHash = node.applicationHash || msg.applicationHash || "my_safe_default";

sort of thing

0 Likes

#3

Where does that line of code go? In the J's file, or from a msg input to the node?

0 Likes

#4

for example see the httprequest node where if you leave the url blank you can inject one using msg.url

0 Likes