Hi, it would be nice to “parse” tags. For example to set a tag like Tags.Name_BranchOffice10 and in a provision you can loop through all set tags for the device, check for tags starting with “Name” to set information dynamically without an ext() script. If there is a way already, how do you achieve it? Thanks in advance.
You can loop through tags and do stuff, which is what I think you want to do? Here’s what my colleague came up with to preserve and reinsert a tag through a bootstrap:
log("bootstrap");
let now = Date.now();
clear("Device", now);
clear("InternetGatewayDevice", now);
const reNoupdate = new RegExp("^Tags\..*noupdate$");
let tags = declare("Tags.*", {value: 1});
let noupdate = false;
for (let tag of tags) {
if (reNoupdate.test(tag.path)) {
noupdate = true;
}
}
declare("Tags.*", null, {value: false});
if (noupdate) {
declare("Tags.noupdate", null, {value: true});
}
Thanks for the example. That’s what I’ve been looking for.