# How to set previous node's output/payload as an input in .html file of a current custom node?

**URL:** <https://discourse.nodered.org/t/how-to-set-previous-nodes-output-payload-as-an-input-in-html-file-of-a-current-custom-node/57912>\
**Category:** Developing Nodes\
**Created:** [7 February 2022 10:19 UTC](https://discourse.nodered.org/t/how-to-set-previous-nodes-output-payload-as-an-input-in-html-file-of-a-current-custom-node/57912 "2022-02-07T10:19:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![chaudharigr17.is](https://avatars.discourse-cdn.com/v4/letter/c/4bbf92/32.png) [@chaudharigr17.is](https://discourse.nodered.org/u/chaudharigr17.is)\
**Post date:** [7 February 2022 10:19 UTC](https://discourse.nodered.org/t/how-to-set-previous-nodes-output-payload-as-an-input-in-html-file-of-a-current-custom-node/57912/1 "2022-02-07T10:19:34Z")

</div>

I am creating a custom node, in which I need to use the previous node's output as input in the current node. for that, I was trying to set "msg.payload" as a value at line number 6, but its not working.

 ![Screenshot from 2022-02-07 15-36-43](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/9/4966e130f5ec5622d56ee5379240867578694c69.png)

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [7 February 2022 13:52 UTC](https://discourse.nodered.org/t/how-to-set-previous-nodes-output-payload-as-an-input-in-html-file-of-a-current-custom-node/57912/2 "2022-02-07T13:52:04Z")

</div>

Welcome to the community. You will, I'm afraid, need to go back and re-read the Node-RED docs on creating custom nodes.

There are three elements to a node. The html file that you have shown and which is inserted into the Editor when you open a Node's settings. The javascript file that is executed partly when Node-RED starts, partly when you add a deply node instance to a flow and partly when you send a msg to a node instance. And finally, the overarching description and config in the node's package.json file. You need all three parts if you want to create a custom node.

It is the javascript file that handles incoming msgs not the html file. And you shouldn't be using a node's Editor panel to show the content of a msg. There is separation between the Editor and the runtime. In the future, you may not even need/want the editor for some things. The editor isn't meant to be a dashboard.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [8 April 2022 13:52 UTC](https://discourse.nodered.org/t/how-to-set-previous-nodes-output-payload-as-an-input-in-html-file-of-a-current-custom-node/57912/3 "2022-04-08T13:52:57Z")

</div>

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