Create 2 tag folder in one folder using system.tag.configure

Hello team,

I am stuck in sometime which i feel is easy but not working out for me. I am trying to create 2 tag folder using system.tag.configure function but i am unable to. Below is the image how i wanted and script which i tried.


in the image above i need to have recipe folder as well along with analysis folder.

type or paste code here

tagToBeAdded = "MC1"
siteSelected = "Pune"
areaSelected = "Dept"
lineSelected = "Non-IT"
getEnterprise = "Test1"
typeId_analysisSite = "SiteAnalysisStatus"
typeId_analysisArea = "AreaAnalysisStatus"
typeId_analysisLine = "AreaAnalysisStatus"
typeId_analysisMachine = "OEEAnalysis"
typeId_analysisMachineRecipe = "Recipe"
tagType = "UdtInstance"
print siteSelected
print areaSelected
print lineSelected
print tagToBeAdded
Tags={'tags' : 
		[
        	{
            'name': siteSelected,   # This section is to add Site Tag Folder
            'tagType': 'Folder',
            'tags' : [
            			{
            			'name': areaSelected,   # This section is to add Site Tag Folder
            			'tagType': 'Folder',
            			'tags': [
            						{
            						'name': lineSelected,
            						'tagType': 'Folder',
            						'tags':[
            								  {
            									'name': tagToBeAdded,
            									'tagType': 'Folder',
            									'tags' : [
        												  {
            												'name': 'Recipe',
            												'tagType': 'Folder',
            												'tags': [{"name": 'udtRecipe',			
            															"typeId" : typeId_analysisMachineRecipe,			
            															"tagType" : tagType}],
            												'name': 'Analysis',
            												'tagType': 'Folder',
                    											'tags': [{"name": 'udtAnalysis',			
            															"typeId" : typeId_analysisMachine,			
            															"tagType" : tagType}]
    														}
    													]	
            								  }
            							   ]
            						}
            					]
            			}
            		  ]

			 }
        ]
 }
system.tag.configure(basePath = getEnterprise,
                    tags = Tags,
                    collisionPolicy = "o"
                )

how frequently do you need to create this structure?
right-click on MC1, hover over New Tag, select New Folder, type Recipe
If you need the same structure on another server or tag provider, right-click on Test1, select Export Tags. On the other server or in the other tag provider, use Import Tags

You're missing the end and open braces for the 2 folders within this folder

2 Likes

that was also an great idea will sure to look into them

You can also just copy the tag json and paste it on the other server if you're lazy like me. All of my ignition tag tools act on the clipboard cause I can't be bothered saving files and trying to find them :sweat_smile: