Hello.
Is there a way to check if tag was created for device or not in provision script?
When i tag a device with a tag “MyTag” and if i use in provision script:
let IfMyTag=declare("Tags.MyTag", {value: 1}).value[0];
log(IfMyTag);
Then i get true in the logs.
But if i remove MyTag from device i see in the logs:
script.TypeError" faultMessage="Cannot read properties of undefined (reading '0')
I am trying to make 2 different scenarios:
When MyTag presents-nothing to do
When MyTag doen’s presents on device-do something and then add MyTag with
declare("Tags.MyTag", null, {value: true});
Is it possible? And if yes-how?