# A possible enhancement for change nodes?

**URL:** https://discourse.nodered.org/t/a-possible-enhancement-for-change-nodes/72010
**Category:** General
**Created:** [10 December 2022 22:53 UTC](https://discourse.nodered.org/t/a-possible-enhancement-for-change-nodes/72010 "2022-12-10T22:53:34Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)
#### Post date: [10 December 2022 22:53 UTC](https://discourse.nodered.org/t/a-possible-enhancement-for-change-nodes/72010/1 "2022-12-10T22:53:34Z")

</div>

In [another thread](https://discourse.nodered.org/t/converting-string-into-json-object/72002), @zenofmud posted a change node with 9 rules.

```auto
[
    {
        "id": "006ee02eff444905",
        "type": "change",
        "z": "e6abd9a54498ec6f",
        "name": "",
        "rules": [
            {
                "t": "change",
                "p": "payload",
                "pt": "msg",
                "from": "Tag",
                "fromt": "str",
                "to": "",
                "tot": "str"
            },
            {
                "t": "change",
                "p": "payload",
                "pt": "msg",
                "from": "(",
                "fromt": "str",
                "to": "{",
                "tot": "str"
            },
            {
                "t": "change",
                "p": "payload",
                "pt": "msg",
                "from": "tag=",
                "fromt": "str",
                "to": "\"tag\":",
                "tot": "str"
            },
            {
                "t": "change",
                "p": "payload",
                "pt": "msg",
                "from": "'",
                "fromt": "str",
                "to": "\"",
                "tot": "str"
            },
            {
                "t": "change",
                "p": "payload",
                "pt": "msg",
                "from": "value=",
                "fromt": "str",
                "to": "\"value\":",
                "tot": "str"
            },
            {
                "t": "change",
                "p": "payload",
                "pt": "msg",
                "from": "type=",
                "fromt": "str",
                "to": "\"type\":",
                "tot": "str"
            },
            {
                "t": "change",
                "p": "payload",
                "pt": "msg",
                "from": "error=",
                "fromt": "str",
                "to": "\"error\":",
                "tot": "str"
            },
            {
                "t": "change",
                "p": "payload",
                "pt": "msg",
                "from": "None),",
                "fromt": "str",
                "to": "\"None\"},",
                "tot": "str"
            },
            {
                "t": "change",
                "p": "payload",
                "pt": "msg",
                "from": "None)]",
                "fromt": "str",
                "to": "\"None\"}]",
                "tot": "str"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 360,
        "y": 520,
        "wires": [
            [
                "0fdea342bae15836"
            ]
        ]
    }
]

```

Not unnaturally, the OP's response was "I'll have to try and work out why each rule is there"

So I suggest an option to add a comment to each rule in the change node for documenting each step.  
To avoid using up more of the already crowded real estate, could comments "hide" behind a dropdown button like this?

 ![Untitled 2](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/8/48b9cbeeda47bb5e1169bc87332d41d963e30399.jpeg)

---

<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: [8 February 2023 22:53 UTC](https://discourse.nodered.org/t/a-possible-enhancement-for-change-nodes/72010/2 "2023-02-08T22:53:44Z")

</div>

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