Converting a python list to a dataset

I have a list of tag paths

paths = ["path/to/tag/1", "path/to/tag/2", "path/to/tag/3", "path/to/tag/4"]

when i use todataSet to make a dataset i get an error


TypeError: toDataSet(): 1st arg can’t be coerced to com.inductiveautomation.ignition.common.script.builtin.DatasetUtilities$PyDataSet

any suggestions? Thanks

Yes, you need to specify the column names for the dataset.

Also, the function takes a list of lists, not a list of strings.

This works:

paths = [[path] for path in paths] system.dataset.toDataSet(["tags"],paths)

More information here: … ataset.htm


1 Like

i called support and they informed me of that. I didn’t need the header info so i left it off thinking it was optional.

Thanks for the help