Building and Using Converter Flows
  • 13 May 2022
  • 3 Minutes to read
  • Dark
    Light

Building and Using Converter Flows

  • Dark
    Light

Article Summary

Overview

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

Warning
It is highly recommended to not edit the default converter Flows, for additional assistance and questions, please contact support@decisions.com
Converter FlowFunctionInputOutput
Convert String to BoolConverts String input to Boolean outputStringConverted Boolean
Convert String to Byte ArrayConverts String input to ByteArray outputStringByteArray 

Convert String to Date

Converts String input to Date outputStringConverted Date

Convert String to Decimal

Converts String input to Decimal outputStringConverted Decimal
Convert String to Int32Converts String input to Int32 outputStringConverted Int32

Convert String to Int64

Converts String input to Int64 outputStringConverted Int64

Get Unique Strings from List

Searches List input for duplicate String inputsListList

Merge String List to Single String

Combines Lists of Strings input to a single list of StringsList of Strings and Separating CharacterMerge List of Strings

Set Decimal Places on Number

Collects number values in a String input and then adds a specified number of decimal placesString to Truncate and Number of Decimal PlacesString Truncated

Trim String Flow

Shortens the String input to specified lengthUntrimmed StringTrimmed 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. 

Sample Project 
The following example can be importedand serve as a guide.
  1. From a Designer Project, select the CREATE FLOW button. Then, CREATE a new Converter Flow by selecting Converter Flow under the Converters category. 

  2. From the Flow Designer, attach a Parse Date step from Toolbox > DATA > DATES, to the Start and End steps.

  3. Select the Start step and navigate to its Properties; under FLOW INPUTS > Flow Input Data, select SHOW EDITOR.

  4. From the Flow Inputs window, enter "DateAsString" and select String [Text] from TYPE. Click Save and close the window.

  5. From the Properties of the Parse Date step, map the Input from the Start step to INPUTS > Date

  6. Navigate to the Properties of the End step. Under DATA > Output, select SHOW EDITOR. 

  7. 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. 

  8. 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. 

  1. In a Designer Project, CREATE a new Flow.
  2. From the Flow Designer, attach a Show Form step from the FAVORITE STEPS category to the Start step.
  3. From the Properties of the Show Form step, select PICK OR CREATE FORM, then create a new Form
  4. 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.

  5. 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.

  6. 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 Information 
    To learn about the different acceptable DateTime formats that can be utilized with the Converter Flow, see DateTime Format in C#.


  7. 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.

  8. 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

  9. Verify that the String has been properly converted into a Date Time value by selecting Show Form > Execution 1 > View Input/Output Data


For further information on Flows, visit the Decisions Forum.



Was this article helpful?