Building and Using Converter Flows
  • 22 Oct 2020
  • 2 Minutes To Read
  • Print
  • Share
  • Dark
    Light

Building and Using Converter Flows

  • Print
  • Share
  • Dark
    Light

Overview

Converter flows are designed to convert data of one data type into another data type (for example, a string into a DateTime). In most cases, using a converter flow is not necessary; 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.

There are many default Converter Flows included with Decisions. They are found under System > Designers > Catalog > System Defaults > Converter Flows. Users can also create their own Converter Flow.

Warning
It is highly recommended to not edit the default converter flows, please contact support@decisions.com if you have any questions.

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

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?