Inserting rows via python script in a table

I have a table that I need to add rows into:

here is the transform I currently have on it where I am appending a column on to the table:

	table = self.getSibling("Table_0").props.data
	accounted_badge_num = [B['Badge_Num'] for B in table]
	json_obj = []
	for V in value:
		py_dic = {"value":dict(V)}
		if py_dic["value"]['BadgeNum'] in accounted_badge_num:
			py_dic["value"]['isAccountedFor'] = True
			py_dic["style"]={"backgroundColor":"green"}
		else:
			py_dic["value"]['isAccountedFor'] = False
		json_obj.append(py_dic)

			
	return json_obj

How do I append rows?

OR is the answer to just use and INSERT INTO on the named query of this table?

What is initiating the row add operation? Is there any data validation?

Probably, the answer is to INSERT the row in the database using whatever method, and then refreshing the binding on the table.

Here is the query from the named query:

SELECT 
	  VP.PERSONNUM AS 'BadgeNum'
	, FORMAT( VP.INPUNCHDTM, 'hh:mm') AS 'ClockINTime'
	, VP.PERSONFULLNAME AS 'Name'
	, HOMELABORLEVELNM5 AS 'Shift'
	, HOMELABORLEVELNM6 AS 'Dept'
	, HOMELABORLEVELDSC7 AS 'JobTitle'
	, HOMELABORLEVELDSC4 AS 'Supervisor'
FROM 
	VP_EMPCUREARNTIME AS VP 
	LEFT OUTER JOIN VP_EMPLOYEEV42 ON VP.PERSONNUM = VP_EMPLOYEEV42.PERSONNUM 
	LEFT OUTER JOIN TIMEZONE ON VP_EMPLOYEEV42.TIMEZONENAME = TIMEZONE.ENGLISH
WHERE 
	(VP.LABORLEVELNAME3 = '0065')
	AND VP.INPUNCHDTM is not Null
	AND VP.LABORLEVELNAME5 NOT IN ('9', 'S')
	AND (VP.STARTDTM > DATEADD(d, - 1, GETDATE()))
	AND (VP.GMTSTARTDTM <= DATEADD(S, - TIMEZONE.GMTOFFSET, GETDATE()))
	AND (VP.GMTENDDTM IS NULL OR VP.GMTENDDTM >= DATEADD(S, - TIMEZONE.GMTOFFSET, GETDATE()))
order by HOMELABORLEVELNM6, HOMELABORLEVELDSC7

When I try and INSERt it tells me that I cant due to effecting other data sources

I was just informed that I cannot mod the database that table was created form, I have READ access only.

Any ideas on how I can add rows via the current transform I am using?

        table = self.getSibling("Table_0").props.data
	accounted_badge_num = [B['Badge_Num'] for B in table]
	json_obj = []
	for V in value:
		py_dic = {"value":dict(V)}
		if py_dic["value"]['BadgeNum'] in accounted_badge_num:
			py_dic["value"]['isAccountedFor'] = True
			py_dic["style"]={"backgroundColor":"green"}
		else:
			py_dic["value"]['isAccountedFor'] = False
		json_obj.append(py_dic)

			
	return json_obj

Well if this is being pulled from a database, then updating just the table in perspective will not do you much good.

As soon as the binding is refreshed for any reason, any changes that have been made will be lost unless you somehow update the database table.

Note that ignition doesn’t run under your credentials but under those that the ignition service is using. So that user needs to have read and write access to the database.