# Displaying Recorded Tag Values Into Tables With Scripting

**URL:** <https://forum.inductiveautomation.com/t/displaying-recorded-tag-values-into-tables-with-scripting/74570>\
**Category:** Ignition\
**Tags:** scripting, vision\
**Created:** [June 5, 2023, 2:10pm UTC](https://forum.inductiveautomation.com/t/displaying-recorded-tag-values-into-tables-with-scripting/74570 "2023-06-05T14:10:13Z")\
**Posts on this page:** 2\
**Page:** 3

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [June 7, 2023, 2:11pm UTC](https://forum.inductiveautomation.com/t/displaying-recorded-tag-values-into-tables-with-scripting/74570/41 "2023-06-07T14:11:06Z")

</div>

So, I'd do something like this.

1. selection of devices/tests
2. button click to run script using the selected devices/tests:

```python
devices = event.source.parent.getComponent('Device_selection_component').data
tests = event.source.parent.getComponent('Test_selection_component').data

results = [
	[
		run_test(dev, test) for test in tests
	] for dev in devices
]

dataset = system.dataset.toPyDataSet(tests, results)
# add a column with the devices name if wanted:
dataset = system.dataset.addColumn(dataset, 0, devices, "devices", str)

event.source.parent.getComponent('Table').data = dataset

```

Note that this is pseudo-code in python/vision style.  
This assumes your tests are executed with a function call `run_test(device, test)`.  
If you have several functions, you could use a mapping, or who a few other different solutions.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [June 7, 2023, 8:17pm UTC](https://forum.inductiveautomation.com/t/displaying-recorded-tag-values-into-tables-with-scripting/74570/42 "2023-06-07T20:17:29Z")

</div>

oops, supposed to be `return True` 🙂 and yes, `removedSuccessful`, while I've never actually used it, is there to be able to retry only those that failed. I actually don't know where i'd ever use it though

[Previous page](https://forum.inductiveautomation.com/t/displaying-recorded-tag-values-into-tables-with-scripting/74570.md?page=2)
