Scripting - UDT - Update memory StringArray

8.1.5

I try to modify an UDT, I have a memory tag inside with type of StringArray, i try to modify using this documentation system.tag.configure - Ignition User Manual 8.1 - Ignition Documentation (EDIT MULTIPLY TAGS) but I always get an error

In my array I store value like this: {“TEST” : [1,2,3,4,5]}

result still alway Error_Configuration(“UDT definition cannot be nested in another UDT definition ([AMT]types/CELL_CONFIG_INFO).”)]

myDict = dict()
arr = [9,8,7,6]
udtPath = "[AMT]_types_/CELL_CONFIG_INFO"
config = system.tag.getConfiguration(udtPath, True)
for tag in config[0]["tags"]:
	if tag["name"] == "status":
		for row in tag["value"]:
			if "TEST" in row:
				print "before", row
				myDict = system.util.jsonDecode(row)
				myDict["TEST"] = arr
				row = system.util.jsonEncode(myDict)
				print "after", row
			
result = system.tag.configure(udtPath, config, "o")
print result

I finaly found the way to do that…

system.tag.configure(basePath = '', tags = configs, collisionPolicy = "o")

To explain this, the basePath argument in the configure function should be the parent path of the tags you want to modify/add. Otherwise, as you found, you will be attempting to create a UDT definition within itself.