I am trying to run the following Power Table Component Scripting in the onCellEdited Extension Function. Ignition Version 8.1.48, The data is stored in SQL Server 2022. The cells update the SQL Server Table but my Power Table does not refresh. If I set the Polling Mode of the Power Table Data Property (also where my original SQL Query resides) to Relative or Absolute then it will refresh when those timers fire. In the past I have been able to use this exact script with no issues.
Can anyone see where I am messing up?
You need to provide a reference to the component, and then the name of the property separately:
system.db.refresh(self, ‘data’)
Looks like you might have confused the argument syntax with the perspective equivalent method of refreshBinding(path.to.component.property)
3 Likes
I created a test Power Table to query a different db table that has test type data stored in it.
The Update Query and the system.db.refresh(self, “data”) appear to function properly.
I went back and tried it on the Power Table that is part of this project and found that the Update query isn’t working properly. Meaning when a cell is edited the table is not updating and the Power Table reverts back to the previous cell data. I’m thinking the Update Query wasn’t working the entire time and I miss-diagnosed the issue as a refresh problem.
Take a look at the query that is populating this Power Table and see if the original query might be the culprit.
I’m not seeing you select ndx
anywhere in that query. Your update statement is probably running but updating something you didn’t intend because you are using the first column value (material in this case) as the value to check for in the ndx
column.
Add ndx
to the front of the selection statement that you’ve shown.(Assuming such a column exists in the table)
1 Like
Thanks again ryan.white, you are saving my bacon. For future reference, I have attached a few pics of the Power Table’s Data Binding, Power Table Scripting, and the Power Table’s Customizer.
This combination appears to be working correctly.