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

Adding entry to data table

Level 9

Adding entry to data table


There is a way to Add/Modify the data table entry, by using a service "AddDataTableEntry" or "AddOrUpdateDataTableEntry", but I can also see that these services also have a return value (string) which is id. I would like to know what is this return 'id'?


Aditya Mittal


Re: Adding entry to data table

From my own documentation when I dealed with it:

"Standard AddDataTableEntry service, returns the newly created id, which it's totally unuseful, you can't query entries by this id, but you can query entries with "key", then we return the corresponding newly created "key" value not the id."


Then based on the values passed as password I have this code to recover the real newly created key:


var result = "";
var rowValues = values.rows[0];
var nVmepk =;
var entry;
for (var i=0;i<nVmepk;i++) {
    entry =[i];
    if ((entry.baseType==="INTEGER")||(entry.baseType==="LONG")) {
        result += (""+parseInt(rowValues[],10));
    } else {
        result += rowValues[];

The previous code depends on having a property called pk with Infotable Pk fields

this pk fields property can be filled with:

// -- Calculate Primary Keys
var dsName = me.GetDataShape();

var ds = DataShapes[dsName];
var fields = ds.GetDataShapeMetadataAsJSON().fieldDefinitions; = Resources["InfoTableFunctions"].CreateInfoTableFromDataShape({
	infoTableName : "InfoTable",
	dataShapeName : "FieldDefinition"
});{ name: "ordinal", baseType: "INTEGER" });

for (var property in fields) {
    if (fields.hasOwnProperty(property)) {
        if (fields[property].aspects) {
            if (fields[property].aspects.isPrimaryKey) {
                    name: property,
                    isPrimaryKey: true,
                    baseType: fields[property].baseType,
                    description: fields[property].desription,
                    dataShape: dsName,
                    ordinal: fields[property].ordinal

Just my experience.