Viewing/Inspecting Dataset Tag Value

I've got a dataset tag that is filled from a script. What's the best way for me to quickly inspect the dataset to see the values? I would typically temporarily bind it to a dataset in a view/window and inspect it there, but wondering if there's something quicker.

TIA

That's what I do. :man_shrugging:

1 Like

I'm pretty sure you can click the value in the tag browser to open a table with the dataset's value...

Otherwise, I'd either do just as you said, or print it in the script console.

here's a print_ds function:

def print_ds(ds, show_rownums=False):
	"""
	Print a dataset in a markdown compatible format.

	params:
		ds:				Dataset to print
		show_rownums:	If true, a column is added at index 0 with the row number
	"""
	headers = list(ds.columnNames)

	if ds.rowCount == 0:
		print "| {} |".format(' | '.join(headers))
		return

	columns = [ds.getColumnAsList(i) for i in xrange(ds.columnCount)]
	if show_rownums:
		headers = [""] + headers
		columns = [range(ds.rowCount)] + columns
	widths = [
		max(
			max(len(unicode(value)) for value in col),
			len(header)
		) for header, col in izip(headers, columns)
	]
	
	print '| {} |'.format(' | '.join(h.ljust(w) for h, w in izip(headers, widths)))
	print '|{}|'.format('|'.join('-'*(w+2) for w in widths))
	print '\n'.join('| {} |'.format(' | '.join(unicode(v).ljust(w) for v, w in izip(row, widths))) for row in izip(*columns))

and here's what you could use in the script console:

ds = system.tag.readBlocking(["your_tag_path"])[0].value
print_ds(ds)
1 Like

Clicking (or double clicking) the value does not work, but expanding the tag and finding the value prop, I can expand that down and it gives a "folder" for each column that can then be expanded to view the values of the column.

I found what I was think of:

double click on the tag to open the tag editor, then click on the little pen icon next to the value:

Except that the dataset is being populated from a runScript() expression, so that doesn't work in this case.

Oh, right, that just for memory tags I guess...

1 Like