Skip to main content
Version: 7.9

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 - Optional. The failover value if type casting fails.

  • Results

    • DataSet - The value type cast as a dataset.

Examples

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