Showing results for 
Search instead for 
Did you mean: 
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

How to insert value to column in Data table


How to insert value to column in Data table

I want to create data table but i can't insert to next column how i can do



you want to insert data in next "ROW" or add new "COLUMN"?

for new "ROW" - use AddDataTablEntries service.

for new Column - Edit its DataShape and add the required one.

I want to add new COLUMN


Nuttapol Pomtong​ : To add column to your DataTable (DT) you will have to update your DataShape(DS). You can edit the associated DS used by DT and add required field using Field Definitions in DS.


22-Sapphire I

Are you saying you are creating an InfoTable and you want to add a column to that InfoTable?

If so use AddField

If you are actually working with a DataTable, you can only insert what is defined in its datashape.

use Add or AddOrUpdate DataTableEntry (ies)

Do you have any example code for Add or AddOrUpdate DataTableEntry (ies)?


Nuttapol, are you looking for something like this

Here SpeedDTDemo is my dataTable on which i am doing single entry insert using the AddDataTableEntry service

var values = Things["SpeedDTDemo"].CreateValues();

values.SpeedVal = inputVal; //NUMBER [Primary Key]

var params = {

sourceType: undefined /* STRING */,

values: values /* INFOTABLE*/,

location: undefined /* LOCATION */,

source: undefined /* STRING */,

tags: undefined /* TAGS */


// result: STRING

var id = Things["SpeedDTDemo"].AddDataTableEntry(params);

If you are simply testing the service you will not see all the data that has been inserted previous to that particular call, for that you either need to navigate to your Datatable > HomeMashup, like i have shown below in the screenshot, or else you have to query your datatable to see the values that has been inserted so far

Hope this helps.

Top Tags