Skip to main content
Version: 8.1

toDataSet

This function is used by Ignition's Expression language..

Description​

Tries to coerce value into a dataset. Not many things can be coerced into datasets. Namely, only datasets and PyDatasets can be coerced into datasets. This is useful for the runScript() expression, to convince the expression compiler to let you assign the return value of a scripting function to a dataset property.

Syntax​

toDataSet(value[, failover])

  • Parameters

    • Object value - The value to type cast, typically a DataSet or PyDataSet.

    • Object failover - The failover value if type casting fails. [optional]

  • Results

    • Dataset - The value type cast as a dataset.

Examples​

Code Snippet
toDataSet(runScript("app.funcs.runSomeFunction()")) //coerces the value returned by a project scripting function into a dataset.