Create dataset and assign to table data

I’m not sure if this is a function of how the code got from Ignition to forum post or an issue in your code, but the code as posted is using curly quotation marks that will throw an error. Put triple back ticks (```) on a line above and below your code in forum posts to make it format well like below. Here’s your code with curly quotation marks replaced. I used single quotation marks, but plain/straight double quotation marks would work as well. The code below will create a dataset like you’re looking for:

headers = ['Date', 'Barrels']
data = [['2/27/19', 67.85]]
data.append(['2/28/19', 72.36])
data.append(['2/29/19', 62.5])
data.append(['3/1/19', 70.98])
data.append(['3/2/19', 75.25])

The other issue is where to put this code. The client startup script event’s parent will not be the container holding the table. You would need to make sure the window is open, get a handle to the window, and then drill down to the table component. Instead, you could:

Assign the value to a memory tag and bind DPTable.data to the memory tag.

system.tag.write('dpData', DP)

Or put the script in the table’s event script like this:

1 Like