Add or Update alert snippet, is not updating the alert
Good day community,
I am making use of In range alerts to change the values associated with my alerts dynamically. Below is my code. It executes successfully. However, the values on my alert do not change. Does anyone know why this is happening?
var params = {
infoTableName: "InfoTable",
dataShapeName: "NumberRangeAlert"/* DATASHAPENAME */
};
var table = Resources["InfoTableFunctions"].CreateInfoTableFromDataShape(params);
table.minimum = Min;
table.minimumInclusive = minInclusive;
table.maximum = max;
table.maximumInclusive = maxInclusive;
table.calculationValue = 1;
table.calculationType = "Percentage";
table.calculationShow=true;
table.propertyValue=13;
let thingProperties = Things[selectedEntity].GetPropertyDefinitions({
category: 'X' /* STRING */,
type: 'Number' /* BASETYPENAME */,
dataShape: "NumberRangeAlert"/* DATASHAPENAME */
});
for(let i =0; i<thingProperties.length; i++){
let name = thingProperties[i].name;
let alertName = "MyAlert1";
var params1 = {
alertType: "InRange" /* STRING */,
alertName: alertName /* STRING */,
property:name /* STRING */,
description: "InRange" /* STRING */,
attributes: table /* INFOTABLE */,
persistent: true /* BOOLEAN */,
priority: 1 /* INTEGER */,
enabled: true /* BOOLEAN */
};
me.AddOrUpdateAlert(params1);
}
Best Regards,

