Checking if tag has alarms or history from system.tag.browse

EDIT: Can I check if tags have alarms and history from system.tag.browse results?

1 Like

Why not just filter the results of your tag browse function on the ‘attributes’ key? If a tag has history enabled the attributes list will contain NodeAttribute[history] and if the tag has alarms it will contain NodeAttribute[alarm].

I thought that might have been the case… I did check them for one tag but apparently I didn’t check a tag that actually had either an alarm or history enabled. Thanks :flushed:

1 Like

Which brings up another good point; not all objects returned by system.tag.browse contain the attributes key, so it would probably be a good idea to retrieve that property using the dictionary .get() method with a fallback value defined rather than directly referencing tag['attributes'].