# Access the object

**URL:** <https://discourse.nodered.org/t/access-the-object/72799>\
**Category:** General\
**Tags:** function-node\
**Created:** [28 December 2022 04:30 UTC](https://discourse.nodered.org/t/access-the-object/72799 "2022-12-28T04:30:03Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jhankhana](https://avatars.discourse-cdn.com/v4/letter/j/35a633/32.png) [@Jhankhana](https://discourse.nodered.org/u/Jhankhana)\
**Post date:** [28 December 2022 04:30 UTC](https://discourse.nodered.org/t/access-the-object/72799/1 "2022-12-28T04:30:03Z")

</div>

Hello!  
I am getting array of the objects at the output. I am able to access elements of zero but unable to access member of the object. I am trying to get minvalue and maxvalue from that object.

Please help me with this!

 ![Screenshot (92)](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/c/6c8c1de7caae19b8d24a926d57fa5bfae49219ee.png)

---

<div class="post-metadata">

**Author:** ![tve](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/tve/32/59475_2.png) [@tve](https://discourse.nodered.org/u/tve)\
**Post date:** [28 December 2022 05:14 UTC](https://discourse.nodered.org/t/access-the-object/72799/2 "2022-12-28T05:14:38Z")

</div>

```auto
msg.payload[0].Agg1_Total_Weight.maxvalue

```

---

<div class="post-metadata">

**Author:** ![Jhankhana](https://avatars.discourse-cdn.com/v4/letter/j/35a633/32.png) [@Jhankhana](https://discourse.nodered.org/u/Jhankhana)\
**Post date:** [28 December 2022 05:22 UTC](https://discourse.nodered.org/t/access-the-object/72799/3 "2022-12-28T05:22:00Z")

</div>

Sorry But could you help me bit more? I wrote as below. It's not giving me any value.

```auto
let one =msg.payload[0].Agg1_Total_Weight.maxvalue;
msg.payload = one;
return msg;

```

---

<div class="post-metadata">

**Author:** ![tve](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/tve/32/59475_2.png) [@tve](https://discourse.nodered.org/u/tve)\
**Post date:** [28 December 2022 05:24 UTC](https://discourse.nodered.org/t/access-the-object/72799/4 "2022-12-28T05:24:08Z")

</div>

Please paste a flow that demonstrates the issue, for example an inject node that produces a sample message, your function node, and a debug node that shows the wrong/missing data. (You can easily copy a whole message object from a debug node in the debug page.)

Edit: it's hard to see, but you have no msg.payload. The entire message object is an array (bad practice). So it would be `msg[0].Agg1_Total_Weight.maxvalue`, but you should really fix the producer of the msg.

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [28 December 2022 05:27 UTC](https://discourse.nodered.org/t/access-the-object/72799/5 "2022-12-28T05:27:41Z")

</div>

The message does not live in msg.payload. Where does the message come from.  
Make sure to [go through the documentation](https://nodered.org/docs/user-guide/messages) to access elements in an object/array.

---

<div class="post-metadata">

**Author:** ![Jhankhana](https://avatars.discourse-cdn.com/v4/letter/j/35a633/32.png) [@Jhankhana](https://discourse.nodered.org/u/Jhankhana)\
**Post date:** [28 December 2022 05:29 UTC](https://discourse.nodered.org/t/access-the-object/72799/6 "2022-12-28T05:29:50Z")

</div>

```auto
[{"id":"2dbaa60.7a9125a","type":"change","z":"24076265.de751e","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"","tot":"date"}],"action":"","property":"","from":"","to":"","reg":false,"x":260,"y":320,"wires":[["7f9287a9.8549b8"]]},{"id":"a42cb46c.27e798","type":"debug","z":"24076265.de751e","name":"","active":true,"console":"false","xaxis":"_time","complete":"false","x":690,"y":220,"wires":[]},{"id":"7f9287a9.8549b8","type":"function","z":"24076265.de751e","name":"","func":"const date = new Date();\n\nlet day = date.getDate();\nlet dayone = 1;\n//let yesterday = date.getDate() -1 ;\nlet month = date.getMonth() + 1;\nlet year = date.getFullYear();\n\nlet yesterDate = `${year}-${month}-${day} 00:00:01`;\nlet currentDate = `${year}-${month}-${day} 23:00:59`;\n//let yesterDate = `2022-11-01 00:00:01`;\n//let currentDate = `2022-11-01 23:00:59`;\nmsg.from=new Date(yesterDate).toISOString();\nmsg.to=new Date(currentDate).toISOString();\nreturn msg;\n\n\n\n\n\n","outputs":"1","language":"javascript","noerr":0,"x":420,"y":320,"wires":[["3a43ab23.2db5f4"]],"outputLabels":["From"]},{"id":"3a43ab23.2db5f4","type":"read aggregates","z":"24076265.de751e","name":"Agg1_Total_Weight","topic":"ded1a0bfec43400f970e566f8263c6d3/BatchMix/Agg1_Total_Weight","topicData":"{\"asset\":\"ded1a0bfec43400f970e566f8263c6d3\",\"assetName\":\"BatchMix\",\"aspect\":\"403f8515fd754ad298be50f5146fd9a8\",\"aspectName\":\"BatchMix\",\"variables\":[{\"name\":\"Agg1_Total_Weight\",\"variableId\":\"TJ96ba993b8c6b\"}]}","topicLabel":"BatchMix/BatchMix/Agg1_Total_Weight","assetName":"","aspectName":"","period":"60","offset":"0","mode":"interval","from":"","datetimepickerFrom":"","to":"","datetimepickerTo":"","timezoneoffset":0,"intervalValue":0,"intervalUnit":"month","count":0,"api":"aggregates","x":610,"y":320,"wires":[["a42cb46c.27e798","640c6afa.da8be4"]]},{"id":"fbd7743e.a46f38","type":"ui_button","z":"24076265.de751e","name":"","group":"6b69c47b.954aec","order":0,"width":0,"singleBrowser":false,"height":0,"passthru":false,"label":"One Month","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"","powerMode":false,"x":70,"y":320,"wires":[["2dbaa60.7a9125a"]]},{"id":"a11ecc24.6c475","type":"debug","z":"24076265.de751e","name":"","active":false,"console":"false","xaxis":"_time","complete":"false","x":1050,"y":320,"wires":[]},{"id":"640c6afa.da8be4","type":"function","z":"24076265.de751e","name":"","func":"\nlet one =msg.payload[0].Agg1_Total_Weight.maxvalue;\n\n//msg.payload = one;\nreturn msg;\n\n\n","outputs":1,"language":"javascript","noerr":0,"x":820,"y":320,"wires":[["a11ecc24.6c475"]],"_type":"node"},{"id":"6b69c47b.954aec","type":"ui_group","z":"","name":"OneMonth","tab":"7ecbab01.42a594","order":1,"disp":true,"width":"20","collapse":false,"_type":"config"},{"id":"7ecbab01.42a594","type":"ui_tab","z":"","name":"DATA","icon":"dashboard","publicAccess":"true","fmAccess":"none","fmAccessType":"private","assetType":"","asset":"","assetName":"","assetText":"","image":"","description":"","hideTitleBar":false,"_type":"config"}]

```

Aggregate node is provided by the mindsphere. Which is giving me output as below in debug page

[{"Agg1\_Total\_Weight":{"firsttime":"2022-12-01T03:57:49.743Z","average":3179369.029846638,"countuncertain":0,"maxvalue":3973255.2,"firstvalue":2368975.8,"countbad":928,"mintime":"2022-12-01T03:57:49.743Z","lastvalue":3973255.2,"sum":48510812657.4,"minvalue":2368975.8,"maxtime":"2022-12-27T12:30:38.374Z","sd":472470.00319455424,"lasttime":"2022-12-27T12:31:38.380Z","countgood":15258},"starttime":"2022-11-30T23:00:00Z","endtime":"2022-12-31T23:00:00Z"}]  
 ![Screenshot (94)](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/5/b5832f19b9cc9794f115b652b4dd0e5f71882908.png)

---

<div class="post-metadata">

**Author:** ![tve](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/tve/32/59475_2.png) [@tve](https://discourse.nodered.org/u/tve)\
**Post date:** [28 December 2022 05:36 UTC](https://discourse.nodered.org/t/access-the-object/72799/7 "2022-12-28T05:36:52Z")

</div>

Did you see my edit above?

---

<div class="post-metadata">

**Author:** ![Jhankhana](https://avatars.discourse-cdn.com/v4/letter/j/35a633/32.png) [@Jhankhana](https://discourse.nodered.org/u/Jhankhana)\
**Post date:** [28 December 2022 05:42 UTC](https://discourse.nodered.org/t/access-the-object/72799/8 "2022-12-28T05:42:29Z")

</div>

Oh, sorry I just read it and did the same but It's giving me error as below  
Error: Cannot read properties of undefined (reading 'Agg1\_Total\_Weight')

---

<div class="post-metadata">

**Author:** ![tve](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/tve/32/59475_2.png) [@tve](https://discourse.nodered.org/u/tve)\
**Post date:** [28 December 2022 05:56 UTC](https://discourse.nodered.org/t/access-the-object/72799/9 "2022-12-28T05:56:49Z")

</div>

You pasted your flow above, but it has the read aggregate node, which I don't have. You need to copy the message going into your function node and paste that here... Ideally with your function node code as well.

---

<div class="post-metadata">

**Author:** ![Jhankhana](https://avatars.discourse-cdn.com/v4/letter/j/35a633/32.png) [@Jhankhana](https://discourse.nodered.org/u/Jhankhana)\
**Post date:** [28 December 2022 06:08 UTC](https://discourse.nodered.org/t/access-the-object/72799/10 "2022-12-28T06:08:08Z")

</div>

Read aggregate node's output going into function node is as below ...

[{"Agg1\_Total\_Weight":{"firsttime":"2022-12-01T03:57:49.743Z","average":3180098.7095534313,"countuncertain":0,"maxvalue":3976252.5,"firstvalue":2368975.8,"countbad":928,"mintime":"2022-12-01T03:57:49.743Z","lastvalue":3976252.5,"sum":48566467492.3,"minvalue":2368975.8,"maxtime":"2022-12-28T03:57:19.256Z","sd":472867.36424514063,"lasttime":"2022-12-28T03:57:19.256Z","countgood":15272},"starttime":"2022-11-30T23:00:00Z","endtime":"2022-12-31T23:00:00Z"}]

Function node:  
What I have written before

```auto
let one= msg.payload[0];
msg.payload= one.maxvalue;
return msg;

```

Then edited

```auto
let one =msg.payload[0].Agg1_Total_Weight.maxvalue;
msg.payload = one;
return msg;

```

anyone of two is not giving any value.

then

```auto
let one =msg[0].Agg1_Total_Weight.maxvalue;
msg.payload = one;
return msg;

```

which is giving error...  
Error: Cannot read properties of undefined (reading 'Agg1\_Total\_Weight')

---

<div class="post-metadata">

**Author:** ![tve](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/tve/32/59475_2.png) [@tve](https://discourse.nodered.org/u/tve)\
**Post date:** [28 December 2022 06:20 UTC](https://discourse.nodered.org/t/access-the-object/72799/11 "2022-12-28T06:20:38Z")

</div>

Haha, this is actually difficult to reproduce 'cause Node-RED is doing everything it can to prevent sending a msg that is an array... That read-aggregate node is pretty messed-up...

Try this: In the function node, add as first line:

```auto
node.warn(msg)

```

and then screen shot or paste what you get in the debug pane.

---

<div class="post-metadata">

**Author:** ![Jhankhana](https://avatars.discourse-cdn.com/v4/letter/j/35a633/32.png) [@Jhankhana](https://discourse.nodered.org/u/Jhankhana)\
**Post date:** [28 December 2022 06:24 UTC](https://discourse.nodered.org/t/access-the-object/72799/12 "2022-12-28T06:24:09Z")

</div>

The other thing I have tried is as below.  
Output of the read aggregate node in function node and in function node written as below..

```auto
let one =msg.payload[0];
msg.payload = one;
return msg;

```

Then output of the function node in split node.Which is giving me 3 parts as below  
1:  
{"firsttime":"2022-12-01T03:57:49.743Z","average":3180098.7095534313,"countuncertain":0,"maxvalue":3976252.5,"firstvalue":2368975.8,"countbad":928,"mintime":"2022-12-01T03:57:49.743Z","lastvalue":3976252.5,"sum":48566467492.3,"minvalue":2368975.8,"maxtime":"2022-12-28T03:57:19.256Z","sd":472867.36424514063,"lasttime":"2022-12-28T03:57:19.256Z","countgood":15272}

2:  
2022-11-30T23:00:00Z

3:  
2022-12-31T23:00:00Z

Output of this split node in change node with  
Set msg.payload to JSONata (parts.index+1) & ": " & payload  
which is giving me above 3 result as three as string.  
Ss, unable to fing what should be done after split node.

```auto
[{"id":"f21a5000.6961e","type":"function","z":"24076265.de751e","name":"","func":"//let array_length = msg.payload.length;\nlet one =msg.payload[0];\n//let last= msg.payload[array_length - 1];\n//msg.payload = one;\nmsg.payload = one;\nreturn msg;\n\n\n/*\nconst Agg1_Total_Weight=msg.payload.maxvalue;\n//let one= Agg1_Total_Weight.maxvalue;\n//msg.payload=Agg1_Total_Weight;\nmsg.payload=Agg1_Total_Weight;\nreturn msg;\n*/","outputs":1,"language":"javascript","noerr":0,"x":820,"y":320,"wires":[["10bb887e.7a6478"]],"_type":"node"},{"id":"10bb887e.7a6478","type":"split","z":"24076265.de751e","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":990,"y":260,"wires":[["3ed5babb.352146","bf79525b.fae62","8fa7f64.6e6be08"]],"_type":"node"},{"id":"3ed5babb.352146","type":"change","z":"24076265.de751e","name":"Prepend line number","rules":[{"t":"set","p":"payload","pt":"msg","to":"(parts.index+1) & \": \" & payload","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":1080,"y":160,"wires":[["6018fc8.b439e04"]],"_type":"node"},{"id":"6018fc8.b439e04","type":"debug","z":"24076265.de751e","name":"","active":true,"console":"false","xaxis":"_time","complete":"false","x":1310,"y":160,"wires":[]},{"id":"bf79525b.fae62","type":"debug","z":"24076265.de751e","name":"","active":true,"console":"false","xaxis":"_time","complete":"false","x":1190,"y":340,"wires":[]}]

```

---

<div class="post-metadata">

**Author:** ![Jhankhana](https://avatars.discourse-cdn.com/v4/letter/j/35a633/32.png) [@Jhankhana](https://discourse.nodered.org/u/Jhankhana)\
**Post date:** [28 December 2022 06:29 UTC](https://discourse.nodered.org/t/access-the-object/72799/13 "2022-12-28T06:29:15Z")

</div>

copy from debug pane

![Screenshot (99)](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/b/5befe99be656a6a7e26b0ab4be1aa06947dc2091.png)  
{"payload":[{"Agg1\_Total\_Weight":{"firsttime":"2022-12-01T03:57:49.743Z","average":3180098.7095534313,"countuncertain":0,"maxvalue":3976252.5,"firstvalue":2368975.8,"countbad":928,"mintime":"2022-12-01T03:57:49.743Z","lastvalue":3976252.5,"sum":48566467492.3,"minvalue":2368975.8,"maxtime":"2022-12-28T03:57:19.256Z","sd":472867.36424514063,"lasttime":"2022-12-28T03:57:19.256Z","countgood":15272},"starttime":"2022-11-30T23:00:00Z","endtime":"2022-12-31T23:00:00Z"}],"socketid":"LQ0JrVMiN7Iwvf\_gABbF","\_dashId":"fbd7743e.a46f38","\_msgid":"4d69e1f6.35116","\_\_history":["2dbaa60.7a9125a","7f9287a9.8549b8","3a43ab23.2db5f4","640c6afa.da8be4"],"\_starttime":1672208743664,"\_correlationId":"75119f00867811ed8156b1e347cd4d61","from":"2022-12-28T00:00:01.000Z","to":"2022-12-28T23:00:59.000Z","topic":"ded1a0bfec43400f970e566f8263c6d3/BatchMix/Agg1\_Total\_Weight"}

---

<div class="post-metadata">

**Author:** ![tve](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/tve/32/59475_2.png) [@tve](https://discourse.nodered.org/u/tve)\
**Post date:** [28 December 2022 06:42 UTC](https://discourse.nodered.org/t/access-the-object/72799/14 "2022-12-28T06:42:53Z")

</div>

> [@Jhankhana](#):
>
> {"payload":[{"Agg1\_Total\_Weight":{"firsttime":"2022-12-

In this case you have a payload... It seems you're trying so many combinations so fast that you're getting wires crossed...  
Just put a function node after the read aggregate value and put the node.warn from above in the very first line, and then paste a screen shot of the result in the debug pane here...

---

<div class="post-metadata">

**Author:** ![Jhankhana](https://avatars.discourse-cdn.com/v4/letter/j/35a633/32.png) [@Jhankhana](https://discourse.nodered.org/u/Jhankhana)\
**Post date:** [28 December 2022 06:55 UTC](https://discourse.nodered.org/t/access-the-object/72799/15 "2022-12-28T06:55:52Z")

</div>

Did the same

{"payload":[{"Agg1\_Total\_Weight":{"firsttime":"2022-07-09T09:23:39.568Z","average":1396018.541708383,"countuncertain":0,"maxvalue":2363601.8,"firstvalue":499117.66,"countbad":679,"mintime":"2022-07-09T09:23:39.568Z","lastvalue":2363601.8,"sum":44396181663.41,"minvalue":499117.66,"maxtime":"2022-07-30T20:22:34.868Z","sd":548327.8553248801,"lasttime":"2022-07-31T21:59:44.158Z","countgood":31802},"starttime":"2022-06-30T22:00:00Z","endtime":"2022-07-31T22:00:00Z"},{"Agg1\_Total\_Weight":{"firsttime":"2022-07-31T22:00:15.537Z","average":2469048.5449149716,"countuncertain":0,"maxvalue":2563734,"firstvalue":2363601.8,"countbad":5,"mintime":"2022-07-31T22:00:15.537Z","lastvalue":2563734,"sum":7404676586.2,"minvalue":2363601.8,"maxtime":"2022-08-02T05:57:42.179Z","sd":86300.84133273154,"lasttime":"2022-08-03T12:32:36.633Z","countgood":2999},"starttime":"2022-07-31T22:00:00Z","endtime":"2022-08-31T22:00:00Z"},{"Agg1\_Total\_Weight":{"firsttime":"2022-09-28T05:36:14.117Z","average":344984.37455096253,"countuncertain":0,"maxvalue":544302.25,"firstvalue":549.18005,"countbad":42,"mintime":"2022-09-28T05:36:14.117Z","lastvalue":544302.25,"sum":1344059123.25055,"minvalue":549.18005,"maxtime":"2022-09-30T12:46:31.851Z","sd":183724.5805056436,"lasttime":"2022-09-30T21:59:33.802Z","countgood":3896},"starttime":"2022-08-31T22:00:00Z","endtime":"2022-09-30T22:00:00Z"},{"Agg1\_Total\_Weight":{"firsttime":"2022-09-30T22:00:03.802Z","average":577885.749993223,"countuncertain":0,"maxvalue":873711.75,"firstvalue":544302.25,"countbad":5,"mintime":"2022-09-30T22:00:03.802Z","lastvalue":873711.75,"sum":5968981911.68,"minvalue":544302.25,"maxtime":"2022-10-12T08:29:20.715Z","sd":80521.6777314963,"lasttime":"2022-10-12T08:56:16.278Z","countgood":10329},"starttime":"2022-09-30T22:00:00Z","endtime":"2022-10-31T23:00:00Z"},{"Agg1\_Total\_Weight":{"firsttime":"2022-11-07T09:30:57.523Z","average":1768738.6248915496,"countuncertain":0,"maxvalue":2367551,"firstvalue":1160052.4,"countbad":0,"mintime":"2022-11-07T09:30:57.523Z","lastvalue":2367551,"sum":20386481390.5,"minvalue":1160052.4,"maxtime":"2022-11-30T12:29:02.908Z","sd":350493.1448188479,"lasttime":"2022-11-30T12:30:02.918Z","countgood":11526},"starttime":"2022-10-31T23:00:00Z","endtime":"2022-11-30T23:00:00Z"},{"Agg1\_Total\_Weight":{"firsttime":"2022-12-01T03:57:49.743Z","average":3180098.7095534313,"countuncertain":0,"maxvalue":3976252.5,"firstvalue":2368975.8,"countbad":928,"mintime":"2022-12-01T03:57:49.743Z","lastvalue":3976252.5,"sum":48566467492.3,"minvalue":2368975.8,"maxtime":"2022-12-28T03:57:19.256Z","sd":472867.3642451427,"lasttime":"2022-12-28T03:57:19.256Z","countgood":15272},"starttime":"2022-11-30T23:00:00Z","endtime":"2022-12-31T23:00:00Z"}],"socketid":"KIr-alDoWA3CVvNCABbZ","\_dashId":"876d2cb4.7d82c","topic":"ded1a0bfec43400f970e566f8263c6d3/BatchMix/Agg1\_Total\_Weight","\_msgid":"463c1955.d75c98","\_\_history":["e6e5ddae.06537","f3889b7e.ac9f78"],"\_starttime":1672210381870,"\_correlationId":"452eb8f0867c11ed90307b97fee8c65f"}

 ![Screenshot (101)](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/b/bb3d5089f77fed03c20b10213849f1cf5e9cda71.png)

---

<div class="post-metadata">

**Author:** ![tve](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/tve/32/59475_2.png) [@tve](https://discourse.nodered.org/u/tve)\
**Post date:** [28 December 2022 07:13 UTC](https://discourse.nodered.org/t/access-the-object/72799/16 "2022-12-28T07:13:35Z")

</div>

Hmmmm, when I put `node.warn(msg)` as first line into a function node I get something looking quite different:

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

Notice how it says "function: (warn)" in the second line in red...

---

<div class="post-metadata">

**Author:** ![Jhankhana](https://avatars.discourse-cdn.com/v4/letter/j/35a633/32.png) [@Jhankhana](https://discourse.nodered.org/u/Jhankhana)\
**Post date:** [28 December 2022 07:19 UTC](https://discourse.nodered.org/t/access-the-object/72799/17 "2022-12-28T07:19:04Z")

</div>

Yes, but somehow, I am not getting message as yours.

---

<div class="post-metadata">

**Author:** ![tve](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/tve/32/59475_2.png) [@tve](https://discourse.nodered.org/u/tve)\
**Post date:** [28 December 2022 07:21 UTC](https://discourse.nodered.org/t/access-the-object/72799/18 "2022-12-28T07:21:53Z")

</div>

hmmm, maybe that requires a setting, I forget. Try `node.error(msg)` instead.

---

<div class="post-metadata">

**Author:** ![Jhankhana](https://avatars.discourse-cdn.com/v4/letter/j/35a633/32.png) [@Jhankhana](https://discourse.nodered.org/u/Jhankhana)\
**Post date:** [28 December 2022 07:25 UTC](https://discourse.nodered.org/t/access-the-object/72799/19 "2022-12-28T07:25:46Z")

</div>

again It's ...

 ![Screenshot (104)](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/4/b46dc6f88175dcb7e1b02a62a44e1d2cbda0120f.png)

---

<div class="post-metadata">

**Author:** ![tve](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/tve/32/59475_2.png) [@tve](https://discourse.nodered.org/u/tve)\
**Post date:** [28 December 2022 07:31 UTC](https://discourse.nodered.org/t/access-the-object/72799/20 "2022-12-28T07:31:38Z")

</div>

Excellent, so there's a payload in that msg. Now comment out the first line with the node.error() and put in the second line:

```auto
return { payload: msg.payload[0].Agg1_Total_Weight.minvalue }

```

Then add a debug node behind the function node and you should see 2368975.8 appear...

[Next page](https://discourse.nodered.org/t/access-the-object/72799.md?page=2)
