Calling a .NET Library Function From a FlowLast Updated: 07/10/2018 Introduced in Version: 2.0
The .NET Library contains a wide range of common functions, classes, and methods that can expedite the development process. To call a .NET Library function from a flow go to the Flow Designer and expand the category Integration > .NET Libraries, and drag a component to the workspace.
In this example, we will create a flow that calls the Copy method to copy text entered in a form’s text box. This what we will refer to later as our Basic Form. This form’s main components are a Text box and an Action button.
This text will display on another form. We will refer to this form as our EndForm. This form contains a Label.
The two forms created for this example were a Basic Form and an EndForm. Navigate to a Designer folder and click the Create Flow button.
We give the flow a name and click CREATE to open it in the Flow Designer.
We start building our flow by adding the form that will capture the text we want to copy. In the Flow Designer Quick Add dialog, go to Flows, Rules, Forms and Reports > Forms [Interaction] > [Pick or Create Form], name the form, Basic Form and select Add.
Format the form with a Button, Label and Textbox. Save and Close the form designer.
Back in the flow designer add the method that will copy the text. In the Tool Box, expand the category Integration > .NET Libraries > System > String (Class) and drag a Copy (Method) component to the workspace.
Finally, we add the form that will displays the copied text. Expand the category Flows, Rules, Forms and Reports > Forms [End] > [Pick or Create End Form], and name the form End Form and select Add. Format the form with the label value from Data> System String Copy System String Method_Output. Save and Close the form designer.
We connect the Start step to the Basic Form step. This is the first form that opens when the flow runs. We connect the Basic Form step to the Copy step which is going to be used to copy the text. We connect the Copy step to the EndForm step that will then display the copied text. Since all of the flow steps are connected, we connect the EndForm step to the End step. Now that the paths are connected, we configure two of the components.
First we double click the System String Copy System String Method step then select the Edit Input Mapping link.
In the Mapping Editor, we connect the form output, the text collected in the Basic Form, to the str input and click OK.
Next, we map the objects for the EndForm. Select the EndForm step and click the Edit Input Mapping link.
In the Mapping Editor, we connect the Copy1_output to the end form’s input and click OK.
This completes the flow. Save and run it in the Debugger to test. In the Flow Designer click Debug.
We click the Form tab to open the Basic Form. We enter text in the field, and click Ok.
After the flow completes, the copied text displays on the EndForm.