How to store Name of the Function to the variable

Dear All,
I have Function with its name. How to get name of the function into the variable?
In pasted example, how can I get "Rok" into the variable in that particular function?
Screenshot 2022-01-28 204420

With node.name

Example Flow :

[{"id":"e88d8d33f7ce918a","type":"function","z":"54efb553244c241f","name":"nodeName","func":"msg.payload = node.name\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":550,"y":940,"wires":[["78848bda70e155d9"]]},{"id":"18e37e3663320978","type":"inject","z":"54efb553244c241f","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":380,"y":940,"wires":[["e88d8d33f7ce918a"]]},{"id":"78848bda70e155d9","type":"debug","z":"54efb553244c241f","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":730,"y":940,"wires":[]}]

let var_name = node.name;

or if you want to see what else the node object holds. look at
let var_name = node;

This becomes immediately obvious if you use the Monaco editor...

chrome_X9F5N8p6kz

2 Likes

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