Modify element of tag array from table cell

Hello! I have a PLC which has a global variable (named SystemVars) that is an array of iSystemVars structs. I am using Ignition Perspective and want to create a table that displays the structs that makeup SystemVars, and have the value column be editable in such a way that the modified value is propagated down to the PLC. I am able to edit the table cell, but the modified value does not propagate to the PLC.

TYPE iSystemVar : STRUCT
   name: string;
   value: INT;
END_STRUCT
END_TYPE

My PLC broadcasts the SystemVars variable on it's OPC UA server which I have created a tag for. So far, I have been able to create a table in Perspective that is able to take the SystemVars tag and populate the table.

Since the tag is of type String, I have the data prop of the table binded to the following script:

def transform(self, value, quality, timestamp):
	import json
	
	# retrieve and format the raw tag data into something sensible
	raw_tag = system.tag.readBlocking("[edge]systemConfig/SystemVars")[0].value
	sys_vars= json.loads(raw_tag) # arr[dict[str, str/float]]
	
	cols = ["Name", "Value"]
	rows = []
	
	for sv in sys_vars:
		if sv["index"] == -1: # empty / placeholder var
			continue
		tmp = []
		tmp.append(sv["name"])
		tmp.append(sv["value"])
		rows.append(tmp)
	
	# return the dataset with the desired cols&rows
	return system.dataset.toDataSet(cols, rows)

To edit the table cell, I am using the following script for the onEditCellCommit component event.

def runAction(self, event):
       # update the table's data prop to reflect the change
	self.props.data = system.dataset.setValue(
		self.props.data, 
		event.rowIndex, 
		event.column, 
		event.value
	)
    # write the new array to the tag
	system.tag.writeBlocking(["[edge]systemConfig/SystemVars"], [self.props.data])

With this script, I am able to edit the cells in the Value row, but the modified value does not propagate to the PLC. The SystemVars array in the PLC does not change. No errors or anything.

I've made sure that the tag is not read-only, and that I have 2 way communication enabled in Perspective. Any ideas? Please let me know if I need to clarify anything or offer more information. Thank you!!

I see you have defined the tag data type as a STRING. You might be better to read the tag in as a Document (JSON) data type, as that is how Ignition OPC UA reads in and write to structs.

You are also attempting to write the data prop directly to the tag. I imagine this would be a dataset, rather than JSON, based on the function you are using to modify the data in run data.

If you look at the QualityCode returned by the system.tag.writeBlocking, you will likely see that it has failed to write to the tag. Try converting your table dataset back to JSON and then writing that to the tag.

As a quick check, you could dump the live tag value in the script console, then also dump the updated value that you are writing back and check whether the structures match.