# Data entered in typedInput() is stored as string in editableList. Unable to get datatype

**URL:** <https://discourse.nodered.org/t/data-entered-in-typedinput-is-stored-as-string-in-editablelist-unable-to-get-datatype/63928>\
**Category:** Developing Nodes\
**Tags:** editable-list\
**Created:** [14 June 2022 15:45 UTC](https://discourse.nodered.org/t/data-entered-in-typedinput-is-stored-as-string-in-editablelist-unable-to-get-datatype/63928 "2022-06-14T15:45:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kvargefar](https://avatars.discourse-cdn.com/v4/letter/k/6bbea6/32.png) [@kvargefar](https://discourse.nodered.org/u/kvargefar)\
**Post date:** [14 June 2022 15:45 UTC](https://discourse.nodered.org/t/data-entered-in-typedinput-is-stored-as-string-in-editablelist-unable-to-get-datatype/63928/1 "2022-06-14T15:45:44Z")

</div>

Hi,

I've created my own node, and it's working fine. I do however find it difficult to read data input from my editableList to the correct format. My challenge is:  
When reading data that is typed into my editablelist, I get the result in string. I found that the method `$("name").editableList('items')[index].find("node-input-elementname").val()` provides me with the correct data, but it's as a string.

**Is there a different method I can use to get the value in correct format? Is there a method that can provide me with the correct datatype that is used with .typedInput()? If so, I could cast the value before storing the value.**  
I use some data input fields with string, some with number, and some where's it's possible to choose:  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/1/71751a9e73b4de1083bdc804332c8fe5c6763b3c.png)

I tried finding the datatype in the jQuery element, but couldn't find anything sensible.

In `oneditsave` I do the following when pushing data to the node:

```auto
var items = $("#node-input-container").editableList('items');
            var node = this;
            node.props = [];
            items.each(function (i) {
                var property = $(this);
                var r = {
                    name: property.find(".node-input-name").val(),
                    high: property.find(".node-input-engHigh").val(),
                    low: property.find(".node-input-engLow").val()
                }
            }
            node.props.push(r);

```

When I do send node.props with `send({"payload":node.props);` in the javascript file, I get _high_ and _low_ in string. I also find these values in string when inspecting the html.

I therefore tried casting the values that are pushed to the node, which worked fine:

```auto
                var r = {
                    name: property.find(".node-input-name").val(),
                    high: Number(property.find(".node-input-engHigh").val()),
                    low: Number(property.find(".node-input-engLow").val())
                }
            }
            node.props.push(r);

```

Here's how I generated the html-areas and used .typedInput():

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/9/c9c5611e3841f451ddd09726ef69e3cd80a5148d.png)  
I initially tried different parameters in typedinput, because I didn't get the result I wanted.

---

<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:** [13 August 2022 15:45 UTC](https://discourse.nodered.org/t/data-entered-in-typedinput-is-stored-as-string-in-editablelist-unable-to-get-datatype/63928/2 "2022-08-13T15:45:57Z")

</div>

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