# JSONata: to payload or not to payload

**URL:** <https://discourse.nodered.org/t/jsonata-to-payload-or-not-to-payload/12857>\
**Category:** General\
**Created:** [3 July 2019 13:11 UTC](https://discourse.nodered.org/t/jsonata-to-payload-or-not-to-payload/12857 "2019-07-03T13:11:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![broo0ose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/broo0ose/32/6430_2.png) [@broo0ose](https://discourse.nodered.org/u/broo0ose)\
**Post date:** [3 July 2019 13:11 UTC](https://discourse.nodered.org/t/jsonata-to-payload-or-not-to-payload/12857/1 "2019-07-03T13:11:19Z")

</div>

Hi,

I may be missing something (probably) but I think there is some inconsistency in the way the JSONata Expression Editor works as opposed to the way expressions must be formatted in the node.

In the test tab of the editor I cannot use a leading payload, but in the actual node I must use the leading payload.

for example if I put **payload.with.content.incident.name** into the node it works fine, but if I use that in the editor test tab it fails.

But if I remove the payload and just put **with.content.incident.name** it works fine in the test tab but fails in the node.

Thanks

Bruce

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [3 July 2019 13:44 UTC](https://discourse.nodered.org/t/jsonata-to-payload-or-not-to-payload/12857/2 "2019-07-03T13:44:34Z")

</div>

Hi @broo0ose

in the expression test tab, where you provide the test data, you are providing the full message object, not just the payload.

```auto
{
   "payload": { "a": 1 }
}

```

---

<div class="post-metadata">

**Author:** ![broo0ose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/broo0ose/32/6430_2.png) [@broo0ose](https://discourse.nodered.org/u/broo0ose)\
**Post date:** [3 July 2019 18:42 UTC](https://discourse.nodered.org/t/jsonata-to-payload-or-not-to-payload/12857/3 "2019-07-03T18:42:33Z")

</div>

yes that's the problem.

Thanks

Bruce
