- 04 Dec 2020
- 1 Minute to read
- Print
- DarkLight
Using the Create Data Step
- Updated on 04 Dec 2020
- 1 Minute to read
- Print
- DarkLight
Overview
The Create Data component can be used to create or copy data objects (or lists of objects). These objects can be used elsewhere in the flow. For example, select the Create Data component. Using the Mapping Editor, add a list of assets such as a computer, monitor, and printer to the hardware catalog. This list can then be used on a Hardware Request form that opens when the flow runs.
Another useful application of the Create Data component is for error handling. A true/false flag can be set when an error occurs.
Example
Begin by navigating to a Designer Folder and clicking the Create Flow button. Give the flow a name and click OK to access the Flow Designer.
Now begin building the flow. In the Steps Panel, select a Create Data step from under the All Steps [Catalog] > Data category and click Add.
To set the data definition for the type of data the Create Data step will use, select the Show Editor button under Data to Create.
In the resulting Data Definitions dialog, enter a name for the data, such as "Computer," then select the Type selector to define the data type.
In this example, the Create Data component will create a string list. Check the "Is List" checkbox to indicate that there will be multiple hardware items (i.e. an array).
The Computer input is set to Constant by default. In the Value box type in names of the computers that you would like to use. When mapped, these values will be available to use throughout a flow.
Select Close to close the Data Definitions dialog. It is also possible to create data values under the Inputs > Computer > Value section in the Properties panel.
To complete the flow, connect the rest of the outcome paths.
Save the flow, and run it in the Debugger.
In the debugger the flow runs successfully, select View Output Data on the Create Data step.
The View Output Data dialog shows the data that was created and passed out. This newly created data can be used in the flow.