Node red: Passing payload into another nodes param

2019-07-25 13:41发布

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.

标签: node-red
1条回答
兄弟一词,经得起流年.
2楼-- · 2019-07-25 14:01

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.

查看更多
登录 后发表回答