- 13 May 2022
- 3 Minutes to read
Building and Using Converter Flows
- Updated on 13 May 2022
- 3 Minutes to read
Converter Flow is a Flow Behavior that is designed to convert Input Data from one Data Type into another. Using a Converter Flow can be used to clean up data that can be handled more elegantly within a process or displayed as desired.
Default Converter Flows
The default Converter Flows are listed below. These options can be found by navigating to System > Designers > Catalog > System Defaults > Converter Flows.
|Convert String to Bool||Converts String input to Boolean output||String||Converted Boolean|
|Convert String to Byte Array||Converts String input to ByteArray output||String||ByteArray|
Convert String to Date
|Converts String input to Date output||String||Converted Date|
Convert String to Decimal
|Converts String input to Decimal output||String||Converted Decimal|
|Convert String to Int32||Converts String input to Int32 output||String||Converted Int32|
Convert String to Int64
|Converts String input to Int64 output||String||Converted Int64|
Get Unique Strings from List
|Searches List input for duplicate String inputs||List||List|
Merge String List to Single String
|Combines Lists of Strings input to a single list of Strings||List of Strings and Separating Character||Merge List of Strings|
Set Decimal Places on Number
|Collects number values in a String input and then adds a specified number of decimal places||String to Truncate and Number of Decimal Places||String Truncated|
Trim String Flow
|Shortens the String input to specified length||Untrimmed String||Trimmed String|
Optimizing Converter Flows
Converter Flows can be optimized by caching their outcomes. This can be done by navigating to the Properties panel for the Flow and expanding the Outcomes header.
From here, users can configure the Cache Outcomes for the Flow. Though there are some limitations:
- If the Converter Flow fetches from a database, the values must match the input values.
- If the Converter Flow fetches data through an API call, the values must match the input values.
For example, if the Converter Flow fetches a string input and its value matches the input used in the Flow, then caching can be used. The only major change can be the data types between the two values.
Building a Converter Flow
The following example demonstrates how to create a Converter Flow that converts String Input into a DateTime value.
From a Designer Project, select the CREATE FLOW button. Then, CREATE a new Converter Flow by selecting Converter Flow under the Converters category.
From the Flow Designer, attach a Parse Date step from Toolbox > DATA > DATES, to the Start and End steps.
Select the Start step and navigate to its Properties; under FLOW INPUTS > Flow Input Data, select SHOW EDITOR.
From the Flow Inputs window, enter "DateAsString" and select String [Text] from TYPE. Click Save and close the window.
From the Properties of the Parse Date step, map the Input from the Start step to INPUTS > Date.
Navigate to the Properties of the End step. Under DATA > Output, select SHOW EDITOR.
From the Output Data window, create a new Data Definition with Date Time selected from TYPE, and ParseDate1_Output mapped to INPUT. Save and close the window.
Save and close the Flow.
Running a Converter Flow
The following section details how to create a Flow that utilizes the previously created Converter Flow.
- In a Designer Project, CREATE a new Flow.
- From the Flow Designer, attach a Show Form step from the FAVORITE STEPS category to the Start step.
- From the Properties of the Show Form step, select PICK OR CREATE FORM, then create a new Form.
- From the Form Designer, design a Form containing a Date Time Picker and a Button control. From the Properties of the Date Time Picker, provide a Data Name; then, Save and close the Form.
Back in the Flow Designer and in Properties of the Show Form step, configure the mapping for the Date Time Picker's Input to the previously created Converter Flow by selecting Converters > [Name of the Converter Flow] from the mapping options.Note on Converter Flow Organization (for v.7.8+)To help accommodate users that have many different Converter Flows in their environment, in installations v.7.8+, Converter Flows are now sorted alphabetically in the mapping menu to make them easier to locate.
After the Converter is applied the Input, locate the Converter Flow's Input underneath the EDIT CONVERTER button. Constant map a String Date in proper Date Time format.Additional InformationTo learn about the different acceptable DateTime formats that can be utilized with the Converter Flow, see DateTime Format in C#.
Connect the Outcome path of the Form step to the End step. Save the Flow, then click the Debug link on the top Action Bar, then click START DEBUGGING.
When the Flow reaches the Form, either use the previously defined String value or select a new one via the Date Time Picker, then click the Submission Button.
Verify that the String has been properly converted into a Date Time value by selecting Show Form > Execution 1 > View Input/Output Data.