# Unable to Use Node Properties in Node Runtime

**URL:** <https://discourse.nodered.org/t/unable-to-use-node-properties-in-node-runtime/21152>\
**Category:** Developing Nodes\
**Created:** [1 February 2020 20:17 UTC](https://discourse.nodered.org/t/unable-to-use-node-properties-in-node-runtime/21152 "2020-02-01T20:17:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sesenlik](https://avatars.discourse-cdn.com/v4/letter/s/c2a13f/32.png) [@sesenlik](https://discourse.nodered.org/u/sesenlik)\
**Post date:** [1 February 2020 20:17 UTC](https://discourse.nodered.org/t/unable-to-use-node-properties-in-node-runtime/21152/1 "2020-02-01T20:17:16Z")

</div>

Hello everyone,  
I am trying to build my own node following docs. I want to add node properties like described in [Node Properties](https://nodered.org/docs/creating-nodes/properties).  
I am able to add some extra properties beside Name property but when I try to send these properties along with the msg.payload, I get undefined in debug node. What am I doing wrong?

My runtime code:

```auto
module.exports = function(RED) {
    function LowerCaseNode(config) {
        RED.nodes.createNode(this,config);		
		this.other1 = config.other1;
		this.other2 = config.other2;
        var node = this;
        node.on('input', function(msg) {
            msg.payload = msg.payload.toLowerCase();
			node.send("Other1: " + node.other1);
			node.send("Other2: " + node.other2);
        });
    }
    RED.nodes.registerType("lower-case",LowerCaseNode);
}

```

My Node template:

```auto
<script type="text/javascript">
    RED.nodes.registerType('lower-case',{
        category: 'function',
        color: '#a6bbcf',
        defaults: {
            name: {value:""},
			other1: {value:""},
			other2: {value:""}
        },
        inputs:1,
        outputs:1,
        icon: "file.png",
        label: function() {
            return this.name||"lower-case";
        }
    });
</script>

<script type="text/html" data-template-name="lower-case">
    <div class="form-row">
        <label for="node-input-name"><i class="icon-tag"></i> Name</label>
        <input type="text" id="node-input-name" placeholder="Name">
	</div>
	<div class="form-row">
		<label for="node-input-other1"><i class="icon-tag"></i> Other1</label>
		<input type="text" id="node-input-other1">
	</div>
	<div class="form-row">
		<label for="node-input-other2"><i class="icon-tag"></i> Other2</label>
		<input type="text" id="node-input-other2">
	</div>
</script>

<script type="text/html" data-help-name="lower-case">
    <p>A simple node that converts the message payloads into all lower-case characters</p>
</script>

```

My flow:

```auto
[
    {
        "id": "837c14c4.912478",
        "type": "inject",
        "z": "ce7e9eec.737d7",
        "name": "",
        "topic": "",
        "payload": "ASD",
        "payloadType": "str",
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "x": 870,
        "y": 620,
        "wires": [
            [
                "32607343.66f30c"
            ]
        ]
    },
    {
        "id": "646d4345.008bac",
        "type": "debug",
        "z": "ce7e9eec.737d7",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "x": 1210,
        "y": 620,
        "wires": []
    },
    {
        "id": "32607343.66f30c",
        "type": "lower-case",
        "z": "ce7e9eec.737d7",
        "name": "",
        "other1": "1",
        "other2": "2",
        "x": 1030,
        "y": 620,
        "wires": [
            [
                "646d4345.008bac"
            ]
        ]
    }
]

```

---

<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:** [1 February 2020 20:19 UTC](https://discourse.nodered.org/t/unable-to-use-node-properties-in-node-runtime/21152/2 "2020-02-01T20:19:29Z")

</div>

I suggest looking at how some other nodes do it.

You need to handle the input from the msg to override the settings if that's what you want.

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [1 February 2020 20:45 UTC](https://discourse.nodered.org/t/unable-to-use-node-properties-in-node-runtime/21152/3 "2020-02-01T20:45:46Z")

</div>

Hi Sadettin,  
I haven't tried your code, but shouldn't you do something like this:

```auto
node.on('input', function(msg) {
   msg.payload = msg.payload.toLowerCase();
   msg.other1 = node.other1;
   msg.other2 = node.other2;
   node.send(msg);
}

```

Because you seem to send a string to the output, instead of a Javascript object...  
Bart

---

<div class="post-metadata">

**Author:** ![sesenlik](https://avatars.discourse-cdn.com/v4/letter/s/c2a13f/32.png) [@sesenlik](https://discourse.nodered.org/u/sesenlik)\
**Post date:** [2 February 2020 07:39 UTC](https://discourse.nodered.org/t/unable-to-use-node-properties-in-node-runtime/21152/4 "2020-02-02T07:39:48Z")

</div>

You are totally right 🙂 Trying your code helped me do what I wanna do. 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:** [2 April 2020 07:39 UTC](https://discourse.nodered.org/t/unable-to-use-node-properties-in-node-runtime/21152/5 "2020-04-02T07:39:53Z")

</div>

Closed on 2 April 2020 07:39 UTC

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