Add items to menu tree from script

Hi,
I've some trouble adding items to a menu tree with scrip.

I'd like to add items with a script when a new MQTT edge nodes appear in my MQTT engine tag provider.
image

Is there first a simple way to add items to a menu tree with a event script ??

Hello. I would leverage a timed event script on the gateway to handle this. It would give more predictable cadence than a tag change on a folder which can execute on quality, timestamp,value changes, etc.

See this code below, I think it will get you started.

item = {
				  "target": "",
				  "items": [],
				  "navIcon": {
				    "path": ""
				  },
				  "label": {
				    "text": "",
				    "icon": {
				      "path": "material/lens",
				      "style": {
				        "classes": "B_Labels/Navigation/AlarmOff"
				      }
				    }
				  },
				  "visible": True,
				  "enabled": True,
				  "showHeader": False,
				  "resetOnClick": False,
				  "backActionText": "",
				  "style": {
				    "classes": "B_Labels/Navigation/BackgroundUnselected"
				  }
				}
			newitem = item
			newitem['enabled'] = your_data
			newitem['label']['text'] = your_data
		
			self.getChild("MenuTree").props.items.append(newitem)

Regards,

Frank

Is there a reason you're not using the Tag Browse Tree component?