Node red: Passing payload into another nodes parameters

南笙酒味 提交于 2019-12-11 05:38:18

问题


Say there is a 'inject' node that injects a string.

This string will consist of '/home/jurgen/Desktop/hello.txt' and will be passed to a 'file in' node. The 'file in' node requires a path to be specified when the 'in file'node is clicked, however I would like to pass the path from the inject node directly. I have tried placing {{payload}} into the 'in file' path parameter but no luck. help.


回答1:


The sidebar Info tab contains documentation for each node that describes what message properties it accepts to control its behaviour.

In the case of the File In node, you will see that it uses msg.filename to set the filename - as long as the filename field is left blank in the node's configuration.

If you create a flow consisting of:

Inject -> Change -> File In -> Debug

You can use the Change node to set msg.filename to whatever value you want to use.



来源:https://stackoverflow.com/questions/44458507/node-red-passing-payload-into-another-nodes-parameters

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!