Why Provision's Script works on every device regardless on Preset

It doesn’t work because tags aren’t an array. The reason the value of a declare would be an array is the first index of the array is the value, the second is the data type.

Put this function in your provision script and use it like so:

if (!hasTag('Huawei_Done')) {
    // Do stuff
}

function hasTag(name) {
    const result = declare(`Tags.${name}`, {value: 1});
    return result.value !== undefined;
}
1 Like