Skip to content

AddTag

Adds a new tag to the instance.

1
myInstance.AddTag(tag: string):Instance

Parameters

string tag
    The tag name to add.

Returns

Always returns the current Instance.

Remarks

Tag existence is checked case-insensitively, so adding a differently cased duplicate does not change the tag list. Characters other than letters, digits, spaces and - _ . + ( ) / \ @ | $ & are removed from the tag. The change is saved when the operation that runs the script completes.

Examples

Tag instances by amount

1
2
3
4
5
6
if ($Xml.EvaluateNumber('Total') > 10000) {
    $Instance.AddTag('HighValue');
}
else {
    $Instance.RemoveTag('HighValue');
}

See Also