- 21 Aug 2024
- 7 Minutes to read
- Print
- DarkLight
Input and Output Mapping Type Overview
- Updated on 21 Aug 2024
- 7 Minutes to read
- Print
- DarkLight
In a Flow, data travels by passing in and out of steps. Data passing into a step, or data used to configure a step's Properties, is referred to as its Input data.
Once the data leaves a step, it is known as its Output data.
The action of applying data to a step is known as mapping; in turn, the method by which data is mapped to a step is known as its Mapping Type. Depending on the Mapping Type, data may be defined from the step itself, or broken into individual properties and mapped separately.
General Usage Tips
In the Flow Designer, selecting a step will populate the Properties tab with step configurations. Steps are typically set up to receive data as inputs, process the data based on the step function, then send the data as outputs. Almost all steps have some sort of input data, but not all steps pass output data.
Once inputs are defined for a step, it is a best practice to deselect the step by clicking into blank space so that the new configurations apply. If there are still exceptions after the inputs have been defined, check to see if there are conflicting datatype issues.
Input Mapping Types
Unknown
The default input mapping type is always set to Unknown, which is not useable for input values at runtime. The box below each input name prompts the user to type in a value/variable or to pick something from the list of provided data that the step can access.
Selecting this mapping type will reveal the list of other mapping types.
Constant
Constant mapping allows a user-defined value will be used as an input. When selecting this mapping type, a field corresponding to the input data type will appear, allowing the value to be specified.
For example, the Show Popup step expects a String input for "Subject" and "Message". Selecting Constant for these fields will present a text box for string entry.
One thing to note with this mapping type is that the value will remain consistent whenever the step is reached at runtime. This is useful for testing purposes in large-scale applications.
Select From Flow
The Select From Flow mapping type uses data from the Flow as an input. This data can be values that are defined as Flow constants, or from steps provided earlier in the Flow.
Selecting this mapping type opens a window where Flow data can be chosen as the specific input. The data type chosen must match the data type for the input field.
Null & Ignore
The Null and Ignore mapping types are often mistaken for having the same function. The difference between the two is that Null sets the input with a null value in Decisions and in the database.
Ignore will disregard the input value entirely. It is important to note that most steps will return an exception for unexpected null or ignored values.
Converters & Run Converter Flow
The Run Converter Flow and mapping types found under Converters both execute a Converter Flow when selected as on the inputs to a step. These mapping types are mainly used to convert data to a specific type before being processed by the step.
It is important to keep in mind that any input or output used with a Converter Flow must be expecting to receive data of the converted output type. Mapping types found under Converters represent pre built Converter Flows while the Run Converter Flow type allows a custom Converter Flows to be created and used.
Merge Plain Text
The Merge Plain Text mapping type is used to define the message of the step. Text is entered into the editor, but the current user email needs to be defined with Flow Data.
To do this, the Flow Data section was expanded on the left side. Hovering the cursor over a piece of data on the left side of this window will show a plus that can be used to add the data value to the editor.
Merge HTML Text
Similar to Merge Plain Text, using Merge HTML Text opens a text editor. However, Merge HTML Text provides additional options such as tables and linking.
In addition, when specifying values for a link, either for images or text, users are able to determine if the link will open a new window. This is defined under the Target input when generating a link.
Constant Date/Constant Date and Time
The Constant Data and Constant Date and Time mapping types are available and replace Constant when dealing with DateTime values in Decisions.
Use this mapping type to define a date or date and time that will constantly be used as the value. In the screenshot below, the Show Form step is configured to always show the constant date for the related values.
Current Date Time
The Current Date Time mapping type shows the date and time as of the moment the input is reached on the step in the Flow.
In the GIF below, this mapping type is used to populate a DateTime Form control. The time that is shown is the time reflected after the Flow was initiated through the Debugger.
Compute Date
The Compute Date mapping type gives some input configuration options for computing a date and time in the future or in the past, based on the defined offset of time. When this mapping type is used, a Compute Type dropdown appears with an option for InFuture or InPast.
Either option must have the Start and Offset inputs configured. If the Start is set for the current date/time and the Offset is one day, the computed date/time should be exactly one day from the date/time of when the input was reached in the Flow.
Build Data
The Build Data mapping type becomes available to use when the properties of a data structure must be built manually. Using this option on an input expecting an object of a certain data type will allow the user to expand the properties of that object and manually map them to input definitions.
For example, a Show Form step receives name, email, and position to create an object of the EmployeeProfile data structure. The Build Data option is used on the inputs to a later step which opens the Mapping Editor and exposes the properties of the EmployeeProfile object. These properties are then mapped as inputs to the later step.
Build Array
The Build Array mapping type works similar to Build Data except that it only applies to inputs that are expecting a list of a data type, such as a String.
For example, two text entries are captured from a Form and sent to the Create Data step, which is expecting a String list called "Customer Cart". The Build Array mapping type is used to add separate items together which compile the array (or list) of String entries.
Output Mapping Types
Rename
If a step contains an output, the step will default to using Rename for its mapping type. This mapping type is mainly used to rename the modified data, providing a way to identify the output on the Data Explorer panel within a Flow.
For example, an Add step takes in two values as the input and returns the sum of those values. The output data of the Add step is renamed to Add_Output automatically to indicate the new data value as it will appear in the Flow. This output data could be renamed to something suitable for the project, like "total". This change will be reflected within the Data Explorer panel.
Change Value
The Change Value mapping type can be used to update existing data that matches the data type to the field. When this outcome is selected, an option to pick the variable will appear.
If the selected data does not have a matching data type, then the step display an error.
Expose Properties
If a Flow step is expected to output a composite datatype, the Expose Properties mapping type can reveal all of the individual data members associated with the composite type.
Those individual properties will need to have output mapping type options of their own selected.
Reference
The Reference mapping functions similarly to the Change Value, creating new data that serves as a reference to the output. This data can then be selected and used later in a Flow.
Pass Through
This mapping type is similar to Rename in that it exists only to pass the data through with the same name, instead of creating a new piece of Flow data that can be used.
The name for the output will default to Output when viewed in the Flow and on the Data Explorer panel.
Ignore and Run Converter
These mapping types operate in the same fashion as they do for inputs, where the value of the output is either ignored or converted using a Flow.