Building and Using Converter Flows
  • 27 Jul 2022
  • 3 Minutes to read
  • Dark
    Light
  This documentation version is deprecated, please click here for the latest version.

Building and Using Converter Flows

  • Dark
    Light

Article summary

Overview

Converter flows are designed to convert data of one data type into another (for example, a string into a DateTime). In most cases, using a converter flow is unnecessary; there is almost always a way to use the data you need in its original state without converting it. However, using a converter flow can be helpful in cleaning up data so it can be handled more elegantly in the process or displayed exactly how you want.

Converter flows are regular flows that have had their Flow Behavior set to function in this way. For information on how to set Flow Behavior, see About Flow Behaviors.

Default Converter Flows

The default Converter Flows included with Decisions are listed below. They are found under System > Designers > Catalog > System Defaults > Converter Flows. Users can also create their own Converter Flow, as shown in the following example.

Warning
It is highly recommended to not edit the default converter Flows; please contact support@decisions.com if you have any questions.
Converter FlowFunctionInputOutput
Convert String to BoolConverts String input to Boolean output
StringConverted Boolean
Convert String to Byte ArrayConverts String input to ByteArray output
StringByteArray 

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 Int32Converts 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
ListList

Merge String List to Single String

Combines Lists of Strings input to a single list of Strings
List 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 places
String to Truncate and Number of Decimal PlacesString Truncated

Trim String Flow

Shortens the String input to a specified length
Untrimmed StringTrimmed String

Example

This example will run a converter flow to change a string into a DateTime. Create a date as a string, then use a converter flow to convert the string into a DateTime with the right format. Below is a downloadable example to import into Decisions.


Start in a Designer Folder by creating the converter flow. Select Create Flow, choose Flow [Converter]. Name and create the flow. This flow will already be set with the Converter Flow behavior.

For more information on how to create a Flow, see Creating Your First Flow.

Configure this flow with a Parse Date With Format step in the Steps tab on the right under Data > Dates.

2019-10-02_160911.png

For the Start step, in the Properties panel on the right under Data Definitions, create a string object called DateAsString and configure the input and output settings as follows.

2019-10-02_144718.png

For the Parse Date With Format step, configure the inputs and outputs as follows.

Learn about the different acceptable DateTime formats for this step here: DataTime Format in C#.

2019-10-02_144755.png

On the End step add an Output. Name this output "Date" with the Type DateTime. Choose the output from the Parse Date with Format step to the Date input on the End Step.

Save and close the flow.

2019-09-30_143017.png

Back in the Designer Folder, create a default flow called Using a Converter Flow.

2019-10-02_164802.png

Add a Show Form step (in the Steps tab on the right under Favorite Steps) and configure it with a Date Time Picker and a Button.

For more information on creating a form, see Creating a Form.

The Date Time Picker control is configured as follows.

2019-10-02_165320.png

Save and close the form.

In the Flow Designer, in the Properties panel on the right under Inputs, configure the mapping type for "Date" as Run Converter, then pick the converter flow that was just created.

Alternate Selection Method 
Alternately, Converters can be accessed and selected by hovering over the Converter menu found in the data mapping options.

In versions 6.19+, the resulting Converter options will be listed alphabetically to make it easier to locate a specific. 

2019-10-02_130228.png

To test the flow, select Debug in the top bar, then select the play arrow to launch the flow. The form will display with the converted date.

Remember, this is the date originally defined as a string with an odd format:

As it is now displayed in the form, it is a DateTime data type and in the correct format.

2019-10-02_162506.png




Was this article helpful?