Clicking button to import table before collecting data

So i have it where when someone fills out a text input - script runs to grab data from table, then writes specific data to tags which are used to display info.

But what I want is the table import button to be done prior to collecting the data. This way I can ensure my table where the data is being grabbed from is up to date.

i am assuming i can do this with a doClick but everytime I add one, it switches me to another window. without the doClick, it does this without actually showing the other windows. code is below.

value = event.source.parent.getComponent('WF Input').text
system.tag.writeToTag('System1/Efficiency/Line_6/WF_Num', value)

system.nav.openWindow("Main Windows/Table Import")
window = system.gui.getWindow("Main Windows/Table Import")
data = window.rootContainer.getComponent("Item Master").data
system.nav.closeWindow("Main Windows/Table Import")

WF = value
	
for row in range(data.rowCount):
	index_row = data.getValueAt(row, 0)
	if index_row == WF:
		prod_nam = data.getValueAt(row, 1)
		bot_size = data.getValueAt(row, 2)
		allergen = data.getValueAt(row, 3)
		system.tag.writeToTag('System1/Efficiency/Line_6/Product_Name', prod_nam)
		system.tag.writeToTag('System1/Efficiency/Line_6/Bottle Size', bot_size)
		system.tag.writeToTag('System1/Efficiency/Line_6/ALLERGEN', allergen)
			

I updated this section

system.nav.openWindow("Main Windows/Table Import")
window = system.gui.getWindow("Main Windows/Table Import")
window.rootContainer.getComponent("Table Import").doClick()
data = window.rootContainer.getComponent("Item Master").data
system.nav.closeWindow("Main Windows/Table Import")

then the import shows up on the current window vs doing it in the background importing then collecting newly imported data to write to tags

Now it works, but the button pops up on the screen for a split second. Is there a way to hide it from showing while running

system.nav.openWindow("Main Windows/Table Import")
window = system.gui.getWindow("Main Windows/Table Import")
button = window.rootContainer.getComponent("Table Import")
button.doClick()
data = window.rootContainer.getComponent("Item Master").data
system.nav.closeWindow("Main Windows/Table Import")

i just turned off visibility for button in the property editor