propertyChange script on Table object

I have a table object with a custom property called “p_data” (type String). I have that property bound to a tag that occasionally changes. In the propertychange scripting of my table I run a script that takes the values in p_data (a string array), creates a dataset and populates the table with the data. I am using the p_data property as the property that should fire the script, but it wont work. It works properly if I create a button object and fire it using the button, but I cannot get it to update using the propertychange. Any help? Here is the script:

if event.propertyName == "p_data":
	inputString = event.source.p_data

	if len(inputString) > 0:
		a=inputString[1:-1].split(',') #Convert the input string into a list.
		z=zip(a[::5],a[1::5],a[2::5],a[3::5],a[4::5],a[5::5]) #Convert resultant list into a paired list.
		tableHeaders=["Event ID","Reason Code","TimeStamp","Cards","Data"]
		tableData=[]
	
#Create data table.
		for i in range(0,len(z)):
			r1=int(z[i][0])
			r2=int(z[i][1])
			r3=int(z[i][2])
			r4=int(z[i][3])
			r5=int(z[i][4])
			tableData.append([r1,r2,r3,r4,r5])
#Populate data table.
		event.source.parent.getComponent('Table P').data=system.dataset.toDataSet(tableHeaders,tableData)

Maybe I’m just not testing it right. When in the preview mode I clear out the p_data property (the text value is empty), then I rebind the value to the tag, so it populates again. The thing is that I don’t get an error, I don’t see anything in the console - it’s like it just ignores it. I know this isn’t the case, but maybe I am doing something wrong. Thanks for any help.

Does it fire during runtime on the client?

For testing I recommend you replace all your code in the propertyChange script with the following code to see exactly which properties are changing:

print event.propertyName,event.newValue

Also, test this in the client, not just in the designer.

Not that I can tell. The data is a list of events coming from a device, and they don’t update often, so I can’t really tell. I guess I could leave it running for a few days to see if anything updates, but I was hoping to get it done soon.

[quote=“nmudge”]For testing I recommend you replace all your code in the propertyChange script with the following code to see exactly which properties are changing:

print event.propertyName,event.newValue

Also, test this in the client, not just in the designer.[/quote]

Did this and saw that, yes, the script was recognizing the property change and was capturing the value using the same testing method I tried before (go to Preview mode, select the data in the property, delete it, paste it back into the property). Not sure why, but this time it seems like it works. If I clear the data from the table and the property, then paste the data back into the property while in the preview mode the table is filled with data as it should be. Weird, but I’ll take it!