# Help expressing a value in Json?

**URL:** https://discourse.nodered.org/t/help-expressing-a-value-in-json/64145
**Category:** General
**Created:** [19 June 2022 20:06 UTC](https://discourse.nodered.org/t/help-expressing-a-value-in-json/64145 "2022-06-19T20:06:41Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Xenos](https://avatars.discourse-cdn.com/v4/letter/x/ea5d25/32.png) [@Xenos](https://discourse.nodered.org/u/Xenos)
#### Post date: [19 June 2022 20:06 UTC](https://discourse.nodered.org/t/help-expressing-a-value-in-json/64145/1 "2022-06-19T20:06:41Z")

</div>

This is an existing issue, I don't think I'm asking the question properly.

I have no issue capturing the data or sending data to my controller. My issue is I cant seam to figure out how to send my captured date (payload) to my output string. what i need to automate is the changing of the "value"

The string I send to my controller is

![Json](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/5/35b6b1156e6bdef42cf74bc924c30efd749c0ee8.jpeg)

What ever I set in "value": "X" presently ( "value": "85"), get written no issues.

how do i make this my payload value?

---

<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: [19 June 2022 20:37 UTC](https://discourse.nodered.org/t/help-expressing-a-value-in-json/64145/2 "2022-06-19T20:37:13Z")

</div>

The quick way is to change the 5 to say `msg.payload`, then change the type of the field in the Change node rule to be `Expression` rather than `JSON`

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [19 June 2022 20:38 UTC](https://discourse.nodered.org/t/help-expressing-a-value-in-json/64145/3 "2022-06-19T20:38:03Z")

</div>

What you have shown is static JSON. You need something dynamic. You have a number of choices.

One way would be to use the JSONata feature instead of plain JSON. That would let you substitute `payload` as a property instead of your fixed `"85"` string.

Another way would be to have 2 changes in your change node. The first to create the JSON and the second to `set` `msg.payload.propertyReferences[0].value` to `payload1.

UPDATE: My first example is what Nick just described.

---

<div class="post-metadata">

### Author: ![Xenos](https://avatars.discourse-cdn.com/v4/letter/x/ea5d25/32.png) [@Xenos](https://discourse.nodered.org/u/Xenos)
#### Post date: [20 June 2022 01:21 UTC](https://discourse.nodered.org/t/help-expressing-a-value-in-json/64145/5 "2022-06-20T01:21:47Z")

</div>

Perfect, Got it...

---

<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: [19 August 2022 01:22 UTC](https://discourse.nodered.org/t/help-expressing-a-value-in-json/64145/6 "2022-08-19T01:22:24Z")

</div>

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