--- title: "toDataSet" description: "Tries to coerce value into a dataset." --- # toDataSet > Tries to coerce value into a dataset. **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()](../advanced/runScript.md) 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 | Type | Parameter | Description | |---|---|---| | 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 ```python title="Code Snippet" toDataSet(runScript("app.funcs.runSomeFunction()")) //coerces the value returned by a project scripting function into a dataset. ```