cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

How to set the reportingStrategy of a remote thing programmatically

Willie
16-Pearl

How to set the reportingStrategy of a remote thing programmatically

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";

1 ACCEPTED SOLUTION

Accepted Solutions

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

View solution in original post

1 REPLY 1

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

Top Tags