Hi All
I’m trying to extend the Canvas Upload Excel Files sample.
I’ve copied the code and have a simple template uploading and displaying correctly. What I would like to do now is lookup from TM1 additional information per row based on the first column, to then be used in the saveItem function.
Below shows the canvas sample code in defining the record values:
var record = {
row: r - startRow + 1,
selected: true,
costCenter: costCenter,
m01: m01,
m02: m02,
m03: m03,
m04: m04,
m05: m05,
m06: m06,
m07: m07,
m08: m08,
m09: m09,
m10: m10,
m11: m11,
m12: m12,
error: error
};
Then I have added the following to return a value base on the cost center:
$tm1Ui.cellGet('veolia','DIM Fin Cost Center',record.costCenter,'Final', 'Stream').then(function(data){
record.division = data.Value;
console.log(record.division);
});
$scope.lists.records.push(record);
The console log shows the division value being returned ok, however, the push statement does not include the new record.division value.
How can I get this new value included in the item that gets pushed to lists.record?
Thanks
David