# Using msg.payload.something as a parametre in the exec node

**URL:** <https://discourse.nodered.org/t/using-msg-payload-something-as-a-parametre-in-the-exec-node/60413>\
**Category:** General\
**Created:** [27 March 2022 16:05 UTC](https://discourse.nodered.org/t/using-msg-payload-something-as-a-parametre-in-the-exec-node/60413 "2022-03-27T16:05:06Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lpkuba088](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/lpkuba088/32/48097_2.png) [@Lpkuba088](https://discourse.nodered.org/u/Lpkuba088)\
**Post date:** [27 March 2022 16:05 UTC](https://discourse.nodered.org/t/using-msg-payload-something-as-a-parametre-in-the-exec-node/60413/1 "2022-03-27T16:05:07Z")

</div>

Lets just say that I have 3 values joined together with topic and the join node. I want to use all 3 of them as parametres in the exec node. How would i do that? (i already did try putting {{{payload.something}}})

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [27 March 2022 16:06 UTC](https://discourse.nodered.org/t/using-msg-payload-something-as-a-parametre-in-the-exec-node/60413/2 "2022-03-27T16:06:30Z")

</div>

There’s a great page in the docs ([Working with messages : Node-RED](https://nodered.org/docs/user-guide/messages)) that will explain how to use the debug panel to find the right path to any data item.

Pay particular attention to the part about the buttons that appear under your mouse pointer when you over hover a debug message property in the sidebar.

![BX00Cy7yHi](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/d/bd1f333a9e043b061b39917c328b0094d3e52d30.gif)

---

<div class="post-metadata">

**Author:** ![Lpkuba088](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/lpkuba088/32/48097_2.png) [@Lpkuba088](https://discourse.nodered.org/u/Lpkuba088)\
**Post date:** [27 March 2022 16:12 UTC](https://discourse.nodered.org/t/using-msg-payload-something-as-a-parametre-in-the-exec-node/60413/3 "2022-03-27T16:12:12Z")

</div>

Thank you for your fast response. But I think the path is correct. For more info: I am trying to send data to PVOutput using curL(this is my command: curl -d "d={{payload.date}}}" -d "t={{payload.time}}" -d "v2={{payload.power}}" -d "v4={{payload.usedpower}}" -d "v6= {{payload.battv}}" -H "X-Pvoutput-Apikey: -api-key-" -H "X-Pvoutput-SystemId: -system id-" [https://pvoutput.org/service/r2/addstatus.jsp](https://pvoutput.org/service/r2/addstatus.jsp))  
This is debug:

 ![Snímek obrazovky 2022-03-27 180921](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/c/bc87290607f767abb16883ead13a16bfe3243cb8.png)  
Basically instead of sending the value, it sends the path to the message. What am i doing wrong?  
(also the top message in debug is before the exec node)

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [27 March 2022 16:16 UTC](https://discourse.nodered.org/t/using-msg-payload-something-as-a-parametre-in-the-exec-node/60413/4 "2022-03-27T16:16:13Z")

</div>

> [@Lpkuba088](#):
>
> this is my command: curl

Why are you shelling out to curl? There is a built in node (http request) that avoids having to spawn command.

---

<div class="post-metadata">

**Author:** ![Lpkuba088](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/lpkuba088/32/48097_2.png) [@Lpkuba088](https://discourse.nodered.org/u/Lpkuba088)\
**Post date:** [27 March 2022 16:18 UTC](https://discourse.nodered.org/t/using-msg-payload-something-as-a-parametre-in-the-exec-node/60413/5 "2022-03-27T16:18:27Z")

</div>

I know about that, but for no apparent reason that doesnt work. I got it to work when i set the values manually but i cant get it work this way. Do you have any idea why could that be? Thanks

---

<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:** [27 March 2022 16:21 UTC](https://discourse.nodered.org/t/using-msg-payload-something-as-a-parametre-in-the-exec-node/60413/6 "2022-03-27T16:21:58Z")

</div>

I agree that you would be probably be better to use the http request node, but to understand why what you have done does not work, if you have put that string in the exec node then the reason is that the exec node does not do expansion using that syntax. To do it, a good way is to use a Template node to build the complete command and pass that to the exec node.

---

<div class="post-metadata">

**Author:** ![Lpkuba088](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/lpkuba088/32/48097_2.png) [@Lpkuba088](https://discourse.nodered.org/u/Lpkuba088)\
**Post date:** [27 March 2022 16:27 UTC](https://discourse.nodered.org/t/using-msg-payload-something-as-a-parametre-in-the-exec-node/60413/7 "2022-03-27T16:27:55Z")

</div>

Thanks! It works now.

---

<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:** [27 March 2022 16:29 UTC](https://discourse.nodered.org/t/using-msg-payload-something-as-a-parametre-in-the-exec-node/60413/8 "2022-03-27T16:29:45Z")

</div>

> [@Lpkuba088](#):
>
> for no apparent reason that doesnt work

Now you should work on making the not apparent become apparent.

---

<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:** [10 April 2022 16:30 UTC](https://discourse.nodered.org/t/using-msg-payload-something-as-a-parametre-in-the-exec-node/60413/9 "2022-04-10T16:30:24Z")

</div>

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