# \[newbie\] Using exec-node with multiple arguments

**URL:** <https://discourse.nodered.org/t/newbie-using-exec-node-with-multiple-arguments/31490>\
**Category:** General\
**Created:** [12 August 2020 17:35 UTC](https://discourse.nodered.org/t/newbie-using-exec-node-with-multiple-arguments/31490 "2020-08-12T17:35:50Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![hugocoolens](https://avatars.discourse-cdn.com/v4/letter/h/e95f7d/32.png) [@hugocoolens](https://discourse.nodered.org/u/hugocoolens)\
**Post date:** [12 August 2020 17:35 UTC](https://discourse.nodered.org/t/newbie-using-exec-node-with-multiple-arguments/31490/1 "2020-08-12T17:35:50Z")

</div>

I'd like to use an exec-node to execute the following command:

```auto
ping -c 1 msg.payload[1]

```

Unfortunately I don't know how to specify msg.payload[1] in the edit window for an exec-node.  
The payload of the previous node contains two parts hence I need msg.payload[1] and not msg.payload

Can anyone here tell me how to accomplish this?

kind regards,  
Hugo

---

<div class="post-metadata">

**Author:** ![JGKK](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jgkk/32/18515_2.png) [@JGKK](https://discourse.nodered.org/u/JGKK)\
**Post date:** [12 August 2020 18:02 UTC](https://discourse.nodered.org/t/newbie-using-exec-node-with-multiple-arguments/31490/2 "2020-08-12T18:02:43Z")

</div>

You cant directly use it but you can put a change node before the exec node configured to set `msg.payload` to `msg.payload[0]` than enter only `ping -c 1` in the exec node and make sure to check the append `msg.payload` option.

Johannes

---

<div class="post-metadata">

**Author:** ![hugocoolens](https://avatars.discourse-cdn.com/v4/letter/h/e95f7d/32.png) [@hugocoolens](https://discourse.nodered.org/u/hugocoolens)\
**Post date:** [13 August 2020 11:47 UTC](https://discourse.nodered.org/t/newbie-using-exec-node-with-multiple-arguments/31490/3 "2020-08-13T11:47:08Z")

</div>

Would it make a chance to ask this ( i.e. possibility to use msg.payload[i] in exec node) as a feature request for a future version of Node-Red?  
kind regards,  
Hugo

---

<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:** [13 August 2020 11:52 UTC](https://discourse.nodered.org/t/newbie-using-exec-node-with-multiple-arguments/31490/4 "2020-08-13T11:52:08Z")

</div>

> [@hugocoolens](#):
>
> I'd like to use an exec-node to execute the following command:
> 
> ```auto
> ping -c 1 msg.payload[1]
> 
> ```

You can use the [node-red-node-ping](https://flows.nodered.org/node/node-red-node-ping) node to do single and multiple pings

> Triggered mode - this mode permits you to trigger the ping by an input message. If the `Target` is left blank and `msg.payload` is a string or array, you can ping 1 or more devices on demand

---

<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:** [12 October 2020 11:52 UTC](https://discourse.nodered.org/t/newbie-using-exec-node-with-multiple-arguments/31490/5 "2020-10-12T11:52:12Z")

</div>

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