Using Custom Data as Flow Input
- Updated on 12 Jun 2013
- 3 minutes to read
Flows can be configured to use entities of any data type that are available including custom ones. To use an entity with a custom data type, check whether the required data type is available in the respective Designer Folder , or create one under the folder System > Designers > Data Structure > All > (Select a data structure) . Once this is done, the custom data type will be available for use in all flows.
Our example flow will consist of a form that will expect an input entity of the custom data type UserInfo , which can then be modified and saved. We'll begin by checking that our custom data type exists in our Designer Folder . We'll find it in the list of entities in our Designer Folder .
Children, or child entities, are data structures which belong to the parent - in this case, UserInfo . These child entities have their own data types and rules. For example, DateOfBirth has the data type Date , which restricts its content to representations of a date on the calendar. Married has the type Boolean , which restricts is content to either true or false. By creating custom data types, we can aggregate simple entities with simple types into more complex structures, such as our UserInfo type.
Now that we know our type exists, we can use it in our custom data flow.
Now we will create a flow that will use our Custom Entity. Go to a Designer Folder and select Create Flow. Name the flow and click OK to continue to the Flow Designer.
Our flow contains a form that will display information from inputs on the start step of the flow. Click on the Start step, and in the Properties panel, underFlow Data > Flow Input Data, select the Show Editor button.
In the Data Definitions dialog, fill in the details of our test object. Name it "User Info". Chose the custom datatype and press. Select CLOSE.
Add a form to the Flow Designer. To do this drag the outcome path of the Start Step to access the quick add window. Under the Favorite Steps category select Show Form. Click Add to add it to the workspace.
Name the form and click Create. The form that will display information uses a Text box, Date Picker, and a check box.
In the Flow Designer select the form and click the Edit Input Mappings link.
Next, map the inputs for the User Info Form . This form contains text boxes for capturing age, date of birth, and marital status. Rather than having these text boxes show up blank, the purpose of introducing the custom data on the Start step is to self populate the form. Which highlights just how dynamic forms are. You can not only write to a form, but you can also read information.
With the form selected in the workspace, click the Edit Input Mappings link in the Properties panel.
Our form fields are the same as the child entities we saw in the detailed description for our User Info data type, so the mappings are straightforward. Connect the Flow Data outputs to the form inputs, then click OK .
Next, we save the flow and run it in the Debugger by clicking Debug Flow .
In the Debugger window we are presented with the option to create Sample Data, Unit Tests, and/or Sample (Session) Data. Click the Sample (Session) Data selector to provide information to the empty User Info object.
Once we've supplied values for the User Info object, we can Run our flow for testing. Also provide an Entity Name for this object.
When we run our debugger now, we see that the form is populated with details of the User Info object we created. We've successfully used our custom data type in a flow.