- 22 Sep 2021
- 2 Minutes to read
- Print
- DarkLight
Create Type From Data
- Updated on 22 Sep 2021
- 2 Minutes to read
- Print
- DarkLight
Overview
In some instances, a user may wish to recreate or track data from a specific Flow. To aid in this, users may utilize the Create Type From Data feature. Create Type From Data is a function found in the Data Definitions window that compiles the configured Data Definitions and converts them into a singular Defined Data Structure.
The following document discusses how to use the Create Type From Data function to convert two String [Text] definitions, into a Defined Data Structure.
Example
Create a Flow that will use the Create Data Step to Create Type From Data in order to make a Flow Structure of the items in the flow. To show the flow structure mapping further down the flow, we will start off the flow with two constant strings and map them in Show Form and Create Data steps.
Steps Used in Example:
- Create Data: All Steps [Catalog] > Data > Create Data
- Show Form: All Steps [Catalog] > Form [Interaction] > Default > Show Form
Configure The Steps:
Begin in a Designer Folder in the bottom action panel select Create Flow, name the flow and select Create.
In the Flow Designer, select the Start Step and navigate to Properties > Flow Data and select Show Editor. Create two inputs of the ‘String’ type. In this example, name one EmployeeName and EmployeeEmail.
For the string inputs, change the mapping type to constant and use an example string for both Inputs. In this example, use EmployeeName Kim Smith and EmployeeEmail kimsmith@emailexample.123.
Next, connect a Show Form step to input the two strings created. Create the Form to look like below.
- Label: Employee’s Name
- Label: Employee’s Email
- Text Box: Data Name -> EmployeeName
- Text Box: Data Name -> EmployeeEmail
- Button: Button Text -> Submit
Save and close the Form, make sure the inputs and outputs in the properties for the Form are correct.
Next, drag and drop the Create Data step to Create Type From Data. Navigate to Properties > Data > Data To Create and select Show Editor. Select Create Type From Data. Name the data name field Company, select Create.
After "Company" is created, select Edit Type to create two strings for EmployeeEmail and EmployeeName. Select SAVE.
In Inputs, select Edit then Build Data for Company. If Build Data does not populate in the dropdown, save and close the flow to recompile.
Then for EmployeeEmail and EmployeeName, Select From Flow for the inputs. Close out of Data Definitions. This will create a Flow Structure called Company with two strings.
Here is the mapping of the two strings going into the Create Type From Data.
After everything is completed and mapped, debug the flow. The form shows select Submit and the flow will create a Flow Structure from the Create Data Step.
Now there is a Flow Structure named Company with strings EmployeeEmail and EmployeeName.