let's suppose infotable results from datatable is somwhat like id =1 and name = "rohit"
will change this name from rohit to rohit_sharma and add it back to empty infotable.
below is the snippet for this
// result: INFOTABLE dataShape: ""
// getting all infotable entries from datatable
var old_infotableresult = Things["infotableTestDT"].GetDataTableEntries({
maxItems: undefined /* NUMBER */
});
// creating an empty infotable using the datashape
var params = {
infoTableName : "InfoTable",
dataShapeName : "infotableTestDS"
};
// CreateInfoTableFromDataShape(infoTableName:STRING("InfoTable"), dataShapeName:STRING):INFOTABLE(infotableTestDS)
var result = Resources["InfoTableFunctions"].CreateInfoTableFromDataShape(params);
// looping out old infotable and updating the required row and again adding the entry to empty new infotable created
var tableLength = old_infotableresult.rows.length;
for (var x=0; x < tableLength; x++) {
var row = old_infotableresult.rows[x];
//Your code here
// infotableTestDS entry object
if(row.id == "1"){
row.name = "rohit_sharma"; // changing from rohit to rohit_sharma
}
var newEntry = new Object();
newEntry.name = row.name; // STRING
newEntry.id = row.id; // STRING [Primary Key]
result.AddRow(newEntry);
}
// in this way result infotable will be returned with updated row while other rows will be returned same as what it used to be