AddRow won't work if field is added runtime
I have a datashape with some fields in it, then I have a "if" condition where I add two more fields to my table but when I add the values using AddRow to those two fields, they won't work.
Here's the code for more details:
var template = Things[entityName].thingTemplate;
var params = {
infoTableName : "InfoTable",
dataShapeName : "GeneralPropertiesTableShape"
};
var propertiesTable = Resources["InfoTableFunctions"].CreateInfoTableFromDataShape(params);
propertiesTable.AddRow({
label: Things[entityName].label,
strain: Things[entityName].strain,
tiltX: Things[entityName].tiltX,
tiltY: Things[entityName].tiltY,
tiltZ: Things[entityName].tiltZ,
temperature: Things[entityName].temperature,
seismic: Things[entityName].seismic
});
switch(template){
case('PointThingTemplate'):
propertiesTable.AddField({name:"substrate", baseType:"STRING"});
propertiesTable.AddRow({substrate: Things[entityName].substrate});
break;
}
my result is I can see the new field "substrate" but I see it empty


