Is there any option to get "config" details in a function node?

Hello All,


I have a configuration in my flow like this, is there any way to get the saved "configuration" in a normal function node? In this case I wanted to get the "share" path(Just like context global.get() or flow.get())

Thanks in advance
Aswin

To my knowledge there isn't - at least, I have never needed to.
This can be seen as a security concern if so, if config nodes have credential info for example.

I of course could be entirerly wrong here.

Hello .. maybe you can utilize Node-red's HTTP Admin API and request the whole flow structure
and from there filter() the Config node you want .. its easier if you give it a meaningful name and filter based on that. A bit unorthodox but it can work.

Example Flow: ( change to your Node-red IP or 127.0.0.1 in the http request node and here my config node is named: myConfigName )

image

[{"id":"f76721acb741bb55","type":"inject","z":"54efb553244c241f","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":180,"y":1720,"wires":[["9b63df0395b4bce0"]]},{"id":"b3cbefec92b59701","type":"http request","z":"54efb553244c241f","name":"","method":"GET","ret":"obj","paytoqs":"ignore","url":"https://192.168.0.7:1880/flows","tls":"","persist":false,"proxy":"","authType":"","senderr":false,"headers":[],"x":510,"y":1720,"wires":[["99b1314d6141b27e"]]},{"id":"7a3aafde7c3132d0","type":"debug","z":"54efb553244c241f","name":"debug 1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":820,"y":1720,"wires":[]},{"id":"9b63df0395b4bce0","type":"function","z":"54efb553244c241f","name":"","func":"// only needed if nr runs on https with self signed cert ?\nmsg.rejectUnauthorized = false;\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":340,"y":1720,"wires":[["b3cbefec92b59701"]]},{"id":"99b1314d6141b27e","type":"function","z":"54efb553244c241f","name":"filter ","func":"// replace string with your config node's name\n\nmsg.payload = msg.payload.filter(el => el.name === \"myConfigName\")\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":670,"y":1720,"wires":[["7a3aafde7c3132d0"]]}]

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