Hello,
In my script I’m trying to find a given tag in each instance of a UDT.
For instance, I have a UDT named Machine. Within that UDT I have a tag named Status. I’d like to find each Status tag and iterate through them.
The issue I’m having is with the filter on the system.tag.browse function using the name parameter. When I filter by name I get no results.
What am I doing wrong? I’m able to filter by dataType and tagType successfully. If I remove the name filter I can successfully list out every tag within every instance of my UDT, so I know I’m getting the right data up until the name filter.
Here’s my script.
#get all instances of the machine UDT under the given tag path
AllUDTInstances = system.tag.browse(TagPath, filter ={'tagType':'UdtInstance', 'typeId': 'Machine'})
#print AllUDTInstances
#loop through the results
for UDTInstance in AllUDTInstances.getResults():
#print UDTInstance
tags = system.tag.browse(UDTInstance['fullPath'], filter = {'name':'Status'})
#print tags
for tag in tags.getResults():
print tag['name']