Solved
What is the best way to set logged = true against all thing properties through a service
What is the best way to set logged = true against all thing properties through a service
What is the best way to set logged = true against all thing properties through a service
Hi!
You can use my script:
var params = {
category: undefined /* STRING */,
type: undefined /* BASETYPENAME */,
dataShape: undefined /* DATASHAPENAME */
};
// result: INFOTABLE dataShape: "PropertyDefinition"
var properties = me.GetPropertyDefinitions(params);
for(var i=0; i<properties.getRowCount(); i++){
if(!isDefault(properties[i]['name'])){
var params = {
propertyName: properties[i]['name'] /* STRING */,
enabled: true /* BOOLEAN */
};
me.SetPropertyLogging(params);
}
}
function isDefault(needle)
{
var defaults = ['name', 'tags', 'thingTemplate', 'description'];
return (defaults.indexOf(needle) > -1);
}
It is checking also if property is deafult or not, so it should be exactly what you are looking for.
Best Regards,
Adam
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.