# Get msg.payload value in exec node

**URL:** <https://discourse.nodered.org/t/get-msg-payload-value-in-exec-node/51612>\
**Category:** General\
**Created:** [28 September 2021 10:08 UTC](https://discourse.nodered.org/t/get-msg-payload-value-in-exec-node/51612 "2021-09-28T10:08:47Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nisha](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nisha/32/45331_2.png) [@Nisha](https://discourse.nodered.org/u/Nisha)\
**Post date:** [28 September 2021 10:08 UTC](https://discourse.nodered.org/t/get-msg-payload-value-in-exec-node/51612/1 "2021-09-28T10:08:47Z")

</div>

I wanted to get the output from http post method which is in msg.payload form to the exec node. How can get it?

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/6/960a3880ffece057f1faa947d7ec69c80962eed5.png)

---

<div class="post-metadata">

**Author:** ![hardillb](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hardillb/32/12373_2.png) [@hardillb](https://discourse.nodered.org/u/hardillb)\
**Post date:** [28 September 2021 10:46 UTC](https://discourse.nodered.org/t/get-msg-payload-value-in-exec-node/51612/2 "2021-09-28T10:46:31Z")

</div>

You tick the box that says "+ Append"

This will add the `msg.payload` to the end of the command executed.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [28 September 2021 10:47 UTC](https://discourse.nodered.org/t/get-msg-payload-value-in-exec-node/51612/3 "2021-09-28T10:47:36Z")

</div>

If @hardillb's answer does not do what you want then tell us what command you are trying to run in the exec node.

---

<div class="post-metadata">

**Author:** ![Nisha](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nisha/32/45331_2.png) [@Nisha](https://discourse.nodered.org/u/Nisha)\
**Post date:** [28 September 2021 11:09 UTC](https://discourse.nodered.org/t/get-msg-payload-value-in-exec-node/51612/4 "2021-09-28T11:09:05Z")

</div>

I tried adding template node before exec node.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [28 September 2021 11:23 UTC](https://discourse.nodered.org/t/get-msg-payload-value-in-exec-node/51612/5 "2021-09-28T11:23:03Z")

</div>

Well that is probably the best way if you want to include the payload value into the command.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [28 September 2021 11:31 UTC](https://discourse.nodered.org/t/get-msg-payload-value-in-exec-node/51612/6 "2021-09-28T11:31:51Z")

</div>

If what you are trying to ask is how to include the value of `msg.payload.ChillerName` into a template string then the first example in the help pane for the template node shows you how to do that. In the example there the value is in `msg.payload.name`.

---

<div class="post-metadata">

**Author:** ![Nisha](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nisha/32/45331_2.png) [@Nisha](https://discourse.nodered.org/u/Nisha)\
**Post date:** [29 September 2021 05:52 UTC](https://discourse.nodered.org/t/get-msg-payload-value-in-exec-node/51612/7 "2021-09-29T05:52:21Z")

</div>

Okay. But What if I want a string message to get in template node. For example, I have print("Success") in python and I want to get this to template node, but it saying invalid identifier.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [29 September 2021 06:26 UTC](https://discourse.nodered.org/t/get-msg-payload-value-in-exec-node/51612/8 "2021-09-29T06:26:19Z")

</div>

> [@Nisha](#):
>
> , I have print("Success") in python and I want to get this to template node

It doesn't matter where it came from, what does it look like in a debug node?

---

<div class="post-metadata">

**Author:** ![Nisha](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nisha/32/45331_2.png) [@Nisha](https://discourse.nodered.org/u/Nisha)\
**Post date:** [29 September 2021 06:28 UTC](https://discourse.nodered.org/t/get-msg-payload-value-in-exec-node/51612/9 "2021-09-29T06:28:38Z")

</div>

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/3/33a23ae9c4f2cd6114a83e0ad50e9a2a7cfe7bb0.png)

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [29 September 2021 07:23 UTC](https://discourse.nodered.org/t/get-msg-payload-value-in-exec-node/51612/10 "2021-09-29T07:23:42Z")

</div>

If you want to get the output of the python into a template node then you have to feed it into a template node.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [29 September 2021 08:00 UTC](https://discourse.nodered.org/t/get-msg-payload-value-in-exec-node/51612/11 "2021-09-29T08:00:35Z")

</div>

I am wondering whether you may not fully understand some of the basic principles of node-red. I recommend watching this playlist: [Node-RED Essentials](https://www.youtube.com/playlist?list=PLyNBB9VCLmo1hyO-4fIZ08gqFcXBkHy-6). The videos are done by the developers of node-red. They're nice & short and to the point. You should understand a whole lot more in about 1 hour. A small investment for a lot of gain.

---

<div class="post-metadata">

**Author:** ![Nisha](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nisha/32/45331_2.png) [@Nisha](https://discourse.nodered.org/u/Nisha)\
**Post date:** [29 September 2021 09:55 UTC](https://discourse.nodered.org/t/get-msg-payload-value-in-exec-node/51612/12 "2021-09-29T09:55:04Z")

</div>

Thank you!

---

<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:** [28 November 2021 09:55 UTC](https://discourse.nodered.org/t/get-msg-payload-value-in-exec-node/51612/13 "2021-11-28T09:55:56Z")

</div>

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