# Table: type of value when editing a cell

**URL:** <https://forum.inductiveautomation.com/t/table-type-of-value-when-editing-a-cell/58692>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [April 21, 2022, 2:07pm UTC](https://forum.inductiveautomation.com/t/table-type-of-value-when-editing-a-cell/58692 "2022-04-21T14:07:22Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![gdube](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/gdube/32/41701_2.png) [@gdube](https://forum.inductiveautomation.com/u/gdube)\
**Post date:** [April 21, 2022, 2:07pm UTC](https://forum.inductiveautomation.com/t/table-type-of-value-when-editing-a-cell/58692/1 "2022-04-21T14:07:22Z")

</div>

Hi guys,  
I’m on Ignition 8.1.15

I noticed that, except for booleans, a cell edit always returns a string value, ie. `event.value` in `onEditCellCommit`is always a string. Is that expected? Do you guys use views to return typed values, or you cast them using for example, `float(event.value)`, in the event?

---

<div class="post-metadata">

**Author:** ![andrews](https://avatars.discourse-cdn.com/v4/letter/a/898d66/32.png) [@andrews](https://forum.inductiveautomation.com/u/andrews)\
**Post date:** [April 23, 2022, 5:48am UTC](https://forum.inductiveautomation.com/t/table-type-of-value-when-editing-a-cell/58692/2 "2022-04-23T05:48:12Z")

</div>

It might help if you can explain exactly what you are trying to do? Context is key.

---

<div class="post-metadata">

**Author:** ![gdube](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/gdube/32/41701_2.png) [@gdube](https://forum.inductiveautomation.com/u/gdube)\
**Post date:** [April 23, 2022, 7:14pm UTC](https://forum.inductiveautomation.com/t/table-type-of-value-when-editing-a-cell/58692/3 "2022-04-23T19:14:22Z")

</div>

I thought I could set a type in a column in a Perspective Table, ie. this column contains numbers. However when I edit a value in the column, it gives me a string instead of a number, which I thought was odd.

---

<div class="post-metadata">

**Author:** ![josborn](https://avatars.discourse-cdn.com/v4/letter/j/4bbf92/32.png) [@josborn](https://forum.inductiveautomation.com/u/josborn)\
**Post date:** [April 23, 2022, 7:18pm UTC](https://forum.inductiveautomation.com/t/table-type-of-value-when-editing-a-cell/58692/4 "2022-04-23T19:18:47Z")

</div>

Like @andrews says, context. Show us what you are trying to do. This, for example is a table with a dataset binding pulling power meter data. You can see that the type is an Integer. Event.Value will be an integer for this field.  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/2/e2aebe9ccd53c37576a68c7ddc90a0a9aec484ff.png)

---

<div class="post-metadata">

**Author:** ![gdube](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/gdube/32/41701_2.png) [@gdube](https://forum.inductiveautomation.com/u/gdube)\
**Post date:** [April 23, 2022, 7:29pm UTC](https://forum.inductiveautomation.com/t/table-type-of-value-when-editing-a-cell/58692/5 "2022-04-23T19:29:26Z")

</div>

Oh… using a Dataset. Interesting.  
I’m using table.data as an array of objects instead.

Here, I entered `1` in the population property using the Perspective Property Editor. By its orange color, we can see that it is typed as a number.  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/b/2b19e16b88cf2f90ee115d404b96189fad23b2c5.png)

Then in preview mode, I edited the column and set `2`. It’s now colored as a string, green.  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/e/3ed8763f12a834b489cd6d657b4c6f641daeedcc.png)

I assumed that setting the `render` prop in `table.columns` to `number` would change the cell editor to a numeric entry field, but I guess not 😕

I’ll try using a DataSet.

table.columns

```auto
[
  {
    "field": "enabled",
    "visible": true,
    "editable": true,
    "render": "auto",
    "justify": "auto",
    "align": "center",
    "resizable": true,
    "sortable": true,
    "sort": "none",
    "viewPath": "",
    "viewParams": {},
    "boolean": "checkbox",
    "number": "value",
    "progressBar": {
      "max": 100,
      "min": 0,
      "bar": {
        "color": "",
        "style": {
          "classes": ""
        }
      },
      "track": {
        "color": "",
        "style": {
          "classes": ""
        }
      },
      "value": {
        "enabled": true,
        "format": "0,0.##",
        "justify": "center",
        "style": {
          "classes": ""
        }
      }
    },
    "toggleSwitch": {
      "color": {
        "selected": "",
        "unselected": ""
      }
    },
    "numberFormat": "0,0.##",
    "dateFormat": "MM/DD/YYYY",
    "width": "",
    "strictWidth": false,
    "header": {
      "title": "",
      "justify": "left",
      "align": "center",
      "style": {
        "classes": ""
      }
    },
    "footer": {
      "title": "",
      "justify": "left",
      "align": "center",
      "style": {
        "classes": ""
      }
    },
    "style": {
      "classes": ""
    }
  },
  {
    "field": "date",
    "visible": true,
    "editable": true,
    "render": "date",
    "justify": "auto",
    "align": "center",
    "resizable": true,
    "sortable": true,
    "sort": "none",
    "viewPath": "",
    "viewParams": {},
    "boolean": "checkbox",
    "number": "value",
    "progressBar": {
      "max": 100,
      "min": 0,
      "bar": {
        "color": "",
        "style": {
          "classes": ""
        }
      },
      "track": {
        "color": "",
        "style": {
          "classes": ""
        }
      },
      "value": {
        "enabled": true,
        "format": "0,0.##",
        "justify": "center",
        "style": {
          "classes": ""
        }
      }
    },
    "toggleSwitch": {
      "color": {
        "selected": "",
        "unselected": ""
      }
    },
    "numberFormat": "0,0.##",
    "dateFormat": "MM/DD/YYYY",
    "width": "",
    "strictWidth": false,
    "header": {
      "title": "",
      "justify": "left",
      "align": "center",
      "style": {
        "classes": ""
      }
    },
    "footer": {
      "title": "",
      "justify": "left",
      "align": "center",
      "style": {
        "classes": ""
      }
    },
    "style": {
      "classes": ""
    }
  },
  {
    "field": "population",
    "visible": true,
    "editable": true,
    "render": "number",
    "justify": "auto",
    "align": "center",
    "resizable": true,
    "sortable": true,
    "sort": "none",
    "viewPath": "",
    "viewParams": {},
    "boolean": "checkbox",
    "number": "value",
    "progressBar": {
      "max": 100,
      "min": 0,
      "bar": {
        "color": "",
        "style": {
          "classes": ""
        }
      },
      "track": {
        "color": "",
        "style": {
          "classes": ""
        }
      },
      "value": {
        "enabled": true,
        "format": "0,0.##",
        "justify": "center",
        "style": {
          "classes": ""
        }
      }
    },
    "toggleSwitch": {
      "color": {
        "selected": "",
        "unselected": ""
      }
    },
    "numberFormat": "0,0.##",
    "dateFormat": "MM/DD/YYYY",
    "width": "",
    "strictWidth": false,
    "header": {
      "title": "",
      "justify": "left",
      "align": "center",
      "style": {
        "classes": ""
      }
    },
    "footer": {
      "title": "",
      "justify": "left",
      "align": "center",
      "style": {
        "classes": ""
      }
    },
    "style": {
      "classes": ""
    }
  }
]

```

---

<div class="post-metadata">

**Author:** ![josborn](https://avatars.discourse-cdn.com/v4/letter/j/4bbf92/32.png) [@josborn](https://forum.inductiveautomation.com/u/josborn)\
**Post date:** [April 23, 2022, 7:56pm UTC](https://forum.inductiveautomation.com/t/table-type-of-value-when-editing-a-cell/58692/6 "2022-04-23T19:56:08Z")

</div>

Thank you, that was helpful. You are correct, its treating it as a string which seems odd. Fortunately you can work around this by casting to an int. Hopefully that is of some help.

This was what i did with my very simplistic test, but you could check the edit is for the appropriate column before doing a cast operation:  
`self.props.data[event['row']][event['column']] = int(event['value'])`
