Getting Started with eMessage Connector and eMessage Agents > Running the Smoke Test > Creating an infotable to Set Model/Serial Number Properties
Creating an infotable to Set Model/Serial Number Properties
The following snippet creates an infotable to set the model and serial number properties of a Thing that is based on the AxedaEMessageGatewayModel Thing Template. Note that extra LF characters have been added to the lines in the InfoTableFunctions group so that the lines fit on a printed page. Remove them if you want to copy/paste this example.
var Thing;
var entityServices = Resources["EntityServices"];
var params = {
name: ThingName,
ThingTemplateName: "AxedaEMessageGatewayModel"
};

// Update regsiteredScripts property
var propUpdateValuesParam = {
infoTableName : "InfoTable",
dataShapeName : "NamedVTQ"
};

var it = Resources["InfoTableFunctions"].
CreateInfoTableFromDataShape(propUpdateValuesParam);
it.AddRow( {name : 'modelNumber',
value : "model_" + ThingName} );
it.AddRow( {name : 'serialNumber',
value : "serial_" + ThingName} );

var updateParams = {
values: it
};

entityServices.CreateThing(params);
Thing = Things[params.name];
Thing.EnableThing();
Thing.RestartThing();
Thing.UpdatePropertyValues(updateParams);
Was this helpful?