Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X
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.
-Durgesh
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.