Skip to main content
16-Pearl
February 10, 2020
Solved

How to set the reportingStrategy of a remote thing programmatically

  • February 10, 2020
  • 1 reply
  • 735 views

How can I set the reportingStrategy of a remote thing programmatically?

Since reportingStrategy is a configuration and not a property, I'm not sure how to do this.

 

For thing properties, I know it is something like the following:

Things[thingname].propertyname = "some value";

Best answer by Constantine

Hello @Willie,

 

This should work:

var conf = Resources["InfoTableFunctions"].CreateInfoTableFromDataShape({ infoTableName : "it", dataShapeName : "ReportingConfiguration" });
conf.AddRow({ reportingStrategy: 'MyReportingStrategy' });
me.SetConfigurationTable({ tableName: 'ReportingConfiguration', configurationTable: conf, persistent: true });

 

Regards,
Constantine

1 reply

18-Opal
February 11, 2020

Hello @Willie,

 

This should work:

var conf = Resources["InfoTableFunctions"].CreateInfoTableFromDataShape({ infoTableName : "it", dataShapeName : "ReportingConfiguration" });
conf.AddRow({ reportingStrategy: 'MyReportingStrategy' });
me.SetConfigurationTable({ tableName: 'ReportingConfiguration', configurationTable: conf, persistent: true });

 

Regards,
Constantine