Help with Tables and Datasets

Hey everyone,

Trying to get a simple dashboard set up for us to be able to scan in bar codes and run queries based on those barcodes scanned. I want to store all my scanned items into a table then use a power table to display the queries based on every barcode scanned in. Currently I am having troubles with getting the first table to update based on a text field. Code is functioning but not updating the table. Any help?

table = event.source.parent.getComponent('inputTable').data
inputData = event.source.text

dataList = []
updatedTable = ''

if event.keyCode == event.VK_ENTER:
	if inputData != '':
		updatedTable = system.dataset.addRow(table, dataList)
		table = updatedTable
		print dataList

The print is just a way to know that when I press enter that something is happening.

Thanks friends.

Pssst! Replace your triple quotes with triple back-quotes. These: ```

1 Like

this is probably not enough
try this
event.source.parent.getComponent('inputTable').data = updatedTable


thank you, been a long night lol

You need to assign to the .data property of the component.

Edit: Victor beat me to it.


Worked. Thanks guys.

1 Like

I generally assign the component itself to a local variable (of the same name) in such scripts. Then all properties are available “naturally”. Something like this:

inputTable = event.source.parent.getComponent('inputTable')

newDS = system.dataset.addRow(, [some stuff]) = newDS

I tend to use proper caps in component names so the corresponding named script objects stand out.

{ If I use the property picker at all, I clean up the resulting code. }