How to append a CSV file in repository(WriteCSV) using CSV Parser function in ThingWorx ?
I'm trying append the csv file in the repository with a service.
My code looks like below.
var params = {
infoTableName : "result",
dataShapeName : "WriteDataShape"
};
// CreateInfoTableFromDataShape(infoTableName:STRING("InfoTable"), dataShapeName:STRING):INFOTABLE(ds1)
var result = Resources["InfoTableFunctions"].CreateInfoTableFromDataShape(params);
var newRow = new Object();
newRow.ID = ID;
newRow.Name = Name;
//infotable1Object.rows[0] = newRow;
result.AddRow(newRow);
var params2 = {
path: "WriteFile.CSV" /* STRING */,
data: result /* INFOTABLE */,
fileRepository: "SystemRepository" /* THINGNAME */,
withHeader: true /* BOOLEAN */
};
// no return
var result = Resources["CSVParserFunctions"].WriteCSVFile(params2);
Could anyone please tell me why the data in CSV file gets overwritten every time I call this service ?

