# Manipulate JSON data

**URL:** <https://discourse.nodered.org/t/manipulate-json-data/82731>\
**Category:** General\
**Created:** [9 November 2023 07:41 UTC](https://discourse.nodered.org/t/manipulate-json-data/82731 "2023-11-09T07:41:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sepp](https://avatars.discourse-cdn.com/v4/letter/s/9d8465/32.png) [@sepp](https://discourse.nodered.org/u/sepp)\
**Post date:** [9 November 2023 07:41 UTC](https://discourse.nodered.org/t/manipulate-json-data/82731/1 "2023-11-09T07:41:13Z")

</div>

hi,  
im sending data in JSON format into an enoceanoutput node. ther is a string represtentes 4 bytes of data. for example: "data": "32000008", first byte contains setpoint in hexformat, other bytes contains settinginfos, etc..

how can i manipulate this fist byte for example to set setpoint by dasboard input

![Capture](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/2/829931bbc05b85fe23324579b1c0e32fa330ed25.png)

 ![Capture1](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/9/a96fcd1ea8b75bf3f03a3a74fa48878e0d56a99a.png)

thanks for any response

---

<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:** [9 November 2023 07:57 UTC](https://discourse.nodered.org/t/manipulate-json-data/82731/2 "2023-11-09T07:57:33Z")

</div>

Here are 3 examples of how it is possible

```auto
[{"id":"0a72b705c7d2788a","type":"inject","z":"d1395164b4eec73e","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"22","payloadType":"str","x":130,"y":1060,"wires":[["f28bbe5d66215e8f","7a4c9438618b8f57","2f8109fb1cad39b3"]]},{"id":"f28bbe5d66215e8f","type":"template","z":"d1395164b4eec73e","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{\n \"meta\":{},\n \"data\": \"{{payload}}000000\"\n}","output":"json","x":320,"y":1060,"wires":[["da2945f704a24adf"]]},{"id":"7a4c9438618b8f57","type":"function","z":"d1395164b4eec73e","name":"function 146","func":"msg.payload = {\n \"meta\":{},\n \"data\": msg.payload + \"000000\"\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":330,"y":1100,"wires":[["c13fe6e024caf81d"]]},{"id":"2f8109fb1cad39b3","type":"change","z":"d1395164b4eec73e","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":" {\t \"meta\":{},\t \"data\": $$.payload & \"000000\"\t}","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":340,"y":1160,"wires":[["2af232e92f908e65"]]},{"id":"6a65d904b2c178c1","type":"inject","z":"d1395164b4eec73e","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"32","payloadType":"str","x":130,"y":1100,"wires":[["f28bbe5d66215e8f","7a4c9438618b8f57","2f8109fb1cad39b3"]]},{"id":"da2945f704a24adf","type":"debug","z":"d1395164b4eec73e","name":"debug 2453","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":530,"y":1060,"wires":[]},{"id":"c13fe6e024caf81d","type":"debug","z":"d1395164b4eec73e","name":"debug 2454","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":530,"y":1100,"wires":[]},{"id":"2af232e92f908e65","type":"debug","z":"d1395164b4eec73e","name":"debug 2455","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":530,"y":1160,"wires":[]}]

```

---

<div class="post-metadata">

**Author:** ![sepp](https://avatars.discourse-cdn.com/v4/letter/s/9d8465/32.png) [@sepp](https://discourse.nodered.org/u/sepp)\
**Post date:** [9 November 2023 09:03 UTC](https://discourse.nodered.org/t/manipulate-json-data/82731/3 "2023-11-09T09:03:24Z")

</div>

👍 thanks

---

<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:** [23 November 2023 09:04 UTC](https://discourse.nodered.org/t/manipulate-json-data/82731/4 "2023-11-23T09:04:05Z")

</div>

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