Using Custom Data as Flow InputLast Updated: 12/05/2018 Introduced in Version: 2.0
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.
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.
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.