Error saving the container?

I have a window with a template repeater and custom variable of type dataset which gets a dataset to which the repeater is bound. The window display looks the way I want and is working as expected, but whenever I save the project I get the following: "Error saving container."

SerializationException: Error during serialization for property 'interactionController' on object '[FPMIWindow]Rack Groups'
	caused by SerializationException: Error during serialization for property 'propertyAdapters' on object '[DefaultInteractionController]com.inductiveautomation.factorypmi.application.binding.DefaultInteractionController@3d093d89'
	caused by SerializationException: Error during serialization for property 'component' on object '[PropertyKey]Template Canvas.templates'
	caused by SerializationException: Error during serialization for property 'templates' on object '[TemplateCanvas]com.inductiveautomation.factorypmi.application.components.TemplateCanvas[Template Canvas,20,15,290x625,layout=com.inductiveautomation.ignition.client.util.gui.FillingLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=9,maximumSize=,minimumSize=,preferredSize=]'
	caused by TypeError: unhashable type: 'dict'


Ignition v8.1.22 (b2022110109)
Java: Azul Systems, Inc. 11.0.16.1

A type error I can understand, but I don't understand why it's being generated from the components within my window. Logs attached.

wrapper.log (3.3 MB)

Looks like you've constructed a dataset that has a dictionary nested within. That produces an unserializable object. Use json instead.

That did it, thanks! My code looks like this:

def rackDataSetBuilder(group):
	path = '[Infrastructure Live Tags]Experiment_Racks/%s' % (group)
	racks = system.tag.browse(path)
	
	headers = ['name','template','parameters','x','y','width','height','layout','z']
	data = []
	for i in range(len(racks)):
		layout = None
		if i%3 == 0: #Make a new line every 3rd template
			layout = 'newline'
		
		parameters = '{\'rackPath\':\'%s\'}' % (str(racks[i]['fullPath']))
		data.append([i, 'Group Rack',parameters,0,0,None,None,layout,None])
	
	dataset = system.dataset.toDataSet(headers, data)
	return dataset

Is there an elegant way to make the parameter variable a json string?

system.util.jsonEncode()

1 Like