Extract eventcode from inform request

Hi,

I am successfully able to get serialNumber and productClass via provision script. However, failing to extract EventCode from Inform Request. Any inputs please?

let serialNumber = declare(“DeviceID.SerialNumber”, {value: 1}).Value[0];

let productClass = declare(“DeviceID.productClass”, {value: 1}).Value[0];

let eventCode = declare(“Event.EventCode”, {value: 1}).Value[0];

Actually it is possible to extract event codes using declare():

const events = [];

for (const e of declare("Events.*", {value: 1})) {
  if (e.value[0] >= Date.now()) events.push(e.path.slice(7));
}

log(JSON.stringify(events));
2 Likes