system.secsgem.toTreeDataset
This function is used in Python Scripting.
Description
Changes an existing dataset, as returned by the system.secsgem.toDataSet function, to make it usable for the Tree View component.
Client Permission Restrictions
This scripting function has no Client Permission restrictions.
Syntax
system.secsgem.toTreeDataSet(dataset)
Parameters
Type | Parameter | Description |
---|---|---|
Dataset | dataset | A DataSet containing a SECS message. Note that this parameter cannot take a JSON message, so the object returned by system.secsgem.getResponse must first be processed by system.secsgem.toDataSet. |
Returns
Dataset - A DataSet containing a SECS message that can be used in the Tree View component.
Scope
Gateway, Designer, Client
Code Examples
Code Snippet
# Assuming the variable named "message" contains a SECS message, we will first convert it to a Dataset.
dataset = system.secsgem.toDataSet(message)
# The initial dataset generated by toDataSet will not work with the Tree View component, so we'll modify it...
dataset = system.secsgem.toTreeDataSet(dataset)
# ...and now pass the dataset into the Tree View component's data property.
event.source.parent.getComponent('Tree View').data = dataset