Editing Cells in Table -- Script Changing Multiple Table Values

So, this is going to be a long one and a bit hard to explain. I have made my tables return as JSON so I can edit the cells inside of the table. I have three columns that can be edited in each table within 4 tables. One is for Maintenance, one is for Electricians, one is for Laborers and the last for Lube Techs. They're separated by "Craft" into 4 different tables. These tables have 3 columns that will be changed via a dropdown in the cell, options for "Status" being Pending, Approved and Denied. We will stick to just the one column for simplicity reasons.

I made the columns dropdowns by doing the following: I made a view with just a dropdown and then creating 4 params on the view as input: values Column, rowIndex and value and an array named ListOfOptions. I then tied the dropdown props.value to the value parameter and the props.options to the ListOfOptions parameter.

Back to the table - under the tables props.columns I set the Status column viewPath to the view that holds the dropdown. I then set 2 viewParams: value Column with the name of the Column being changed and an array named ListOfOptions with a bunch of options with label and value such as "Pending", "Approved", "Denied" and so on. I found out how to complete this via another forum post.

After creating my first table, my script runs flawlessly. It will change the value to what is selected, update the database, then write a log into my log table. However, once I added the scripting to the second table (same exact script, only changing the refresh binding at the end) it wants to change both tables at once to the same selection. Here is my script inside of the props.selection.data.0.Status, for example:

	FirstName = self.props.selection.data[0].Fname
	LastName = self.props.selection.data[0].Lname
	ClockNumber = self.props.selection.data[0].EID
	Status = self.props.selection.data[0].Status
	if self.getSibling("Table Dates Selected Label").props.text == self.getSibling("Sat Button").props.text:
		Date = self.getSibling("Saturday Date").props.formattedValue
	elif self.getSibling("Table Dates Selected Label").props.text == self.getSibling("Sun Button").props.text:
		Date = self.getSibling("Sunday Date").props.formattedValue
		Date = self.getSibling("Check Signup").props.formattedValue
	Today = system.date.now()
	Time = system.date.format(Today, "MM/dd/YYYY hh:mm:ss a")
	userID = self.session.props.auth.user.userName
	if currentValue.value == 1 and previousValue.value != 1:
		Type = "Approved"
		LogEntry = userID + " set " + LastName + ", " + FirstName + " (" + ClockNumber + ") overtime to approved for the date of " + str(Date) + "."
	elif currentValue.value == 2 and previousValue.value != 2:
		Type = "Denied"
		LogEntry = userID + " set " + LastName + ", " + FirstName + " (" + ClockNumber + ") overtime to denied for the date of " + str(Date) + "."
	elif currentValue.value == 0 and previousValue.value != 0:
		Type = "Pending"
		LogEntry = userID + " set " + LastName + ", " + FirstName + " (" + ClockNumber + ") overtime to pending for the date of " + str(Date) + "."
	params = {"FirstName" :FirstName, "LastName" :LastName, "ClockNumber" :ClockNumber, "Status" :Status, "Date" :Date}
	logParams = {"Time" :Time, "LogEntry" :LogEntry, "Type" :Type}

	#Runs query to update database table
	system.db.runNamedQuery("Overtime/Trade Tables/Status Update Query", params)

	#Runs query to add to log
	system.db.runNamedQuery("Configuration/Logs/Log Entry", logParams)

	#Refreshes approved counter
	self.getSibling("Lube Techs Approved").refreshBinding("props.text")

I'm not sure if it's the "self.props.selection.data[0].xxx" that is hitting on multiple tables for some reason or what is going on. It doesn't really make sense to me though as it is a self property. All the Status Update Query does is set the Status = :Status where "FirstName" = :FirstName and "LastName" = :LastName and "ClockNumber" = :ClockNumber and "Date" = :Date.

Thank you in advance for taking your time to read this post and helping out.

How is the script being triggered? Is it possible that the script is fine but is being run multiple times (once for each table)?

Can you add some instrumentation to test that? (In my head that's "add a printf" even though every technology has a different syntax for that and console.writeln or debug.writeln or ...)

The script is located on the selected data field being changed, so in this case when the status selection is changed it will run the script. The problem is it's running on another table that isn't being changed at the time..I'm not sure how I would test this

I am new to Ignition so I am not sure either, but this looks like a Request for A Sanity Check to me, or as one guy used to put it "I don't understand everything I know about this"

The approach is often to put a console.log("here") and console.log("here2") in the code. Or add a global variable hitCount and do hitCount++ at the top. or referenceCount with referenceCount++ at the top and referenceCount-- at the bottom. Or system.diagnostics.assert(self.getName == "Bob", "Unexpected trigger!").

So far my best implementation of those is system.util.getLogger("Test").info("here") and system.tag.writeBlocking("[default]MyMemoryTag", variableInQuestion

After playing around with it some more I'm realizing the change is due to all of the same tables having a message handler listening for "UpdateColumn". I changed the other table to listen for "UpdateColumn2" and it is no longer changing.