# Batch node and how to access the content

**URL:** https://discourse.nodered.org/t/batch-node-and-how-to-access-the-content/22961
**Category:** General
**Created:** [11 March 2020 11:43 UTC](https://discourse.nodered.org/t/batch-node-and-how-to-access-the-content/22961 "2020-03-11T11:43:53Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Beefy\_carrot](https://avatars.discourse-cdn.com/v4/letter/b/ccd318/32.png) [@Beefy\_carrot](https://discourse.nodered.org/u/Beefy_carrot)
#### Post date: [11 March 2020 11:43 UTC](https://discourse.nodered.org/t/batch-node-and-how-to-access-the-content/22961/1 "2020-03-11T11:43:53Z")

</div>

How do i access the values in a batch node ? i have set it up so 10 readings from my sensor gets added to the batch file and it then sends it to the cloud. but i would rather have the average number of these ten readings. batch = msg.complete, payload = msg.payload

---

<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: [11 March 2020 12:01 UTC](https://discourse.nodered.org/t/batch-node-and-how-to-access-the-content/22961/2 "2020-03-11T12:01:43Z")

</div>

send the output to a join node and from there you could use a function node to compute the average or possible some contrib node

---

<div class="post-metadata">

### Author: ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)
#### Post date: [11 March 2020 13:03 UTC](https://discourse.nodered.org/t/batch-node-and-how-to-access-the-content/22961/3 "2020-03-11T13:03:44Z")

</div>

If you look at the info panel for the join node - you can see it has a "reduce" mode - with an example that does indeed calculate the average of the values for you.

---

<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: [11 March 2020 21:44 UTC](https://discourse.nodered.org/t/batch-node-and-how-to-access-the-content/22961/4 "2020-03-11T21:44:42Z")

</div>

I thought you were already using a Join node, as you indicated in [your original thread](https://discourse.nodered.org/t/multiple-readings/22703/3)

---

<div class="post-metadata">

### Author: ![Beefy\_carrot](https://avatars.discourse-cdn.com/v4/letter/b/ccd318/32.png) [@Beefy\_carrot](https://discourse.nodered.org/u/Beefy_carrot)
#### Post date: [12 March 2020 14:04 UTC](https://discourse.nodered.org/t/batch-node-and-how-to-access-the-content/22961/5 "2020-03-12T14:04:50Z")

</div>

Sorry about that, it worked but not as intended. i am experimenting with different types of approaches. for different functions. i am not very familiar with node red as i am to python, java and js. currently thinking to just use the function nodes all the way ^^

---

<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: [11 May 2020 14:04 UTC](https://discourse.nodered.org/t/batch-node-and-how-to-access-the-content/22961/6 "2020-05-11T14:04:57Z")

</div>

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