# No access to msg.payload Object

**URL:** <https://discourse.nodered.org/t/no-access-to-msg-payload-object/100440>\
**Category:** General\
**Created:** [23 February 2026 17:43 UTC](https://discourse.nodered.org/t/no-access-to-msg-payload-object/100440 "2026-02-23T17:43:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rolzan](https://avatars.discourse-cdn.com/v4/letter/r/4af34b/32.png) [@rolzan](https://discourse.nodered.org/u/rolzan)\
**Post date:** [23 February 2026 17:43 UTC](https://discourse.nodered.org/t/no-access-to-msg-payload-object/100440/1 "2026-02-23T17:43:15Z")

</div>

I'm wondering why I don't have access to the msg object. As you can see in the attachment, the object exists and is populated.

For example, when I try to output “msg.payload.outHumidity” in a function, I get “undefined.” I don't understand this.

 ![Bildschirmfoto vom 2026-02-23 18-32-04](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/b/6bcacbdc0a00b3c91120c53a40ccf7f5f5c01769.png)

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [23 February 2026 17:50 UTC](https://discourse.nodered.org/t/no-access-to-msg-payload-object/100440/2 "2026-02-23T17:50:45Z")

</div>

More info is required, can you export you example flow.

[How to import/export a flow](https://nodered.org/docs/user-guide/editor/workspace/import-export)

Then post here following these instructions

In order to make code readable and usable it is necessary to surround your code with three backticks (also known as a left quote or backquote `````)

````auto
``` 
   code goes here 
```

````

You can edit and correct your post by clicking the pencil ✏ icon.

See this post for more details - [How to share code or flow json](https://discourse.nodered.org/t/how-to-share-code-or-flow-json/506)

---

<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:** [23 February 2026 18:01 UTC](https://discourse.nodered.org/t/no-access-to-msg-payload-object/100440/3 "2026-02-23T18:01:48Z")

</div>

> [@rolzan](#):
>
> when I try to output “msg.payload.outHumidity” in a function

what does this mean? how are you "outputting" this?

where is that debug message coming from - before the function or after it? (i.e. what creates that data)

if you want to use `msg.payload.outHumidity` in the function then you can just do so:

```auto
const outHumidity = msg.payload.outHumidity
const inHumidity = msg.payload.inHumidity
const outHumidityNum = +outHumidity
const inHumidityNum = +inHumidity
node.warn({
   outHumidity,
   outHumidityNum,
   inOutHumidityDiff: outHumidityNum - inHumidityNum
})

```

Here is the docs for working with functions: [Writing Functions : Node-RED](https://nodered.org/docs/user-guide/writing-functions)

---

<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:** [24 May 2026 18:02 UTC](https://discourse.nodered.org/t/no-access-to-msg-payload-object/100440/4 "2026-05-24T18:02:16Z")

</div>

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